use of com.ctrip.platform.dal.daogen.host.java.JavaColumnNameResultSetExtractor in project dal by ctripcorp.
the class GenTaskBySqlBuilderResource method getTableColumnSqlType.
/**
* @param set_name
* @param table_name
* @return <column alias, sqltype>
*/
private Map<String, Integer> getTableColumnSqlType(String set_name, String table_name, String modeType) throws Exception {
String dbName = AllInOneNameUtils.getAllInOneName(set_name, modeType);
DatabaseCategory dbCategory = DbUtils.getDatabaseCategory(dbName);
List<AbstractParameterHost> paramsHost = DbUtils.getAllColumnNames(dbName, table_name, new JavaColumnNameResultSetExtractor(dbName, table_name, dbCategory));
Map<String, Integer> map = new HashMap<>();
if (paramsHost != null) {
for (int i = 0; i < paramsHost.size(); i++) {
JavaParameterHost paramHost = (JavaParameterHost) paramsHost.get(i);
map.put(paramHost.getAlias().toLowerCase(), paramHost.getSqlType());
}
}
return map;
}
Aggregations