use of org.dbflute.properties.assistant.classification.DfClassificationAllInOneSqlExecutor in project dbflute-core by dbflute.
the class DfClassificationProperties method processAllInOneTableClassification.
// -----------------------------------------------------
// All-in-One Table Classification
// -------------------------------
protected void processAllInOneTableClassification(Connection conn, String sql) {
final DfClassificationAllInOneSqlExecutor executor = new DfClassificationAllInOneSqlExecutor();
final List<Map<String, String>> resultList = executor.executeAllInOneSql(conn, sql);
for (Map<String, String> map : resultList) {
final String classificationName = map.get("classificationName");
final DfClassificationTop classificationTop;
{
DfClassificationTop tmpTop = _classificationTopMap.get(classificationName);
if (tmpTop == null) {
tmpTop = createAllInOneTableClassificationTop(classificationName);
_classificationTopMap.put(classificationName, tmpTop);
}
classificationTop = tmpTop;
}
// }
if (!classificationTop.hasTopComment()) {
final String topComment = map.get(DfClassificationTop.KEY_TOP_COMMENT);
classificationTop.setTopComment(topComment);
}
if (!classificationTop.hasCodeType()) {
final String codeType;
{
String tmpType = map.get(DfClassificationTop.KEY_CODE_TYPE);
if (Srl.is_Null_or_TrimmedEmpty(tmpType)) {
// for compatibility
tmpType = map.get(DfClassificationTop.KEY_DATA_TYPE);
}
codeType = tmpType;
}
classificationTop.setCodeType(codeType);
}
final DfClassificationElement element = new DfClassificationElement();
element.setClassificationName(classificationName);
element.acceptBasicItemMap(map);
classificationTop.addClassificationElement(element);
}
}
Aggregations