public class MappingUtil extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MappingUtil.Usage
Holder for a set of keys, table and column names
|
Constructor and Description |
---|
MappingUtil() |
Modifier and Type | Method and Description |
---|---|
static Set<String> |
analyze(Collection<MappingUtil.Usage> usages)
Analyzes correlation and returns the combined set of keys
|
static Collection<String> |
loadKeys(String filename)
Loads keys from an ordered line-delimited file
|
static void |
saveKeys(Collection<String> keys,
String filename)
Saves keys to an ordered line-delimited file
|
static void |
saveMappingFile(Collection<String> keys,
String filename,
String prefix)
Creates mappings to prefix with a sequence and saves as a Java properties file
|
static ResultSet |
sqlExecuteQuery(Connection conn,
String cmd)
Executes a SQL statement and returns a resultset
|
static MappingUtil.Usage |
sqlRead(Connection conn,
String table,
String column,
String where)
Reads values from <table>.<column> into a Usage instance
|
public static MappingUtil.Usage sqlRead(Connection conn, String table, String column, String where) throws SQLException
conn
- Connectiontable
- namecolumn
- namewhere
- clauseSQLException
- exceptionpublic static ResultSet sqlExecuteQuery(Connection conn, String cmd) throws SQLException
conn
- Connectioncmd
- SQL commandSQLException
- exceptionpublic static Collection<String> loadKeys(String filename) throws FileNotFoundException
filename
- of fileFileNotFoundException
- when file missingpublic static void saveKeys(Collection<String> keys, String filename) throws IOException
keys
- stringsfilename
- nameIOException
- when problems writing filepublic static Set<String> analyze(Collection<MappingUtil.Usage> usages)
usages
- Collection of Usagespublic static void saveMappingFile(Collection<String> keys, String filename, String prefix) throws IOException
keys
- to savefilename
- for mapping fileprefix
- for propertiesIOException
- when problems writing mapping fileCopyright © 2021. All rights reserved.