use of org.dbflute.properties.assistant.classification.DfClassificationTop in project dbflute-core by dbflute.
the class DfClsTableAllInOneArranger method arrangeAllInOneTableClassification.
public void arrangeAllInOneTableClassification(Map<String, DfClassificationTop> classificationTopMap, 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);
}
}
use of org.dbflute.properties.assistant.classification.DfClassificationTop in project dbflute-core by dbflute.
the class DfClassificationResourceDefinitionReflector method reflectClassificationResourceToDefinition.
// ===================================================================================
// Reflect to Definition
// =====================
public void reflectClassificationResourceToDefinition(Map<String, DfClassificationTop> classificationTopMap) {
final Set<String> alreadySet = new HashSet<String>(classificationTopMap.keySet());
for (DfClassificationTop resourcePresentsTop : _resourcePresentsTopList) {
final String classificationName = resourcePresentsTop.getClassificationName();
if (alreadySet.contains(classificationName)) {
throwClassificationAlreadyExistsInDfPropException(classificationName, "ClassificationResource");
}
// reflect to classification top definition
classificationTopMap.put(classificationName, resourcePresentsTop);
}
}
use of org.dbflute.properties.assistant.classification.DfClassificationTop in project dbflute-core by dbflute.
the class DfClassificationResourceDeploymentReflector method reflectClassificationResourceToDeployment.
// ===================================================================================
// Reflect to Deployment
// =====================
public void reflectClassificationResourceToDeployment(Supplier<Map<String, String>> allColumnClassificationMapProvider) {
final List<DfClassificationTop> classificationTopList = _resourcePresentsTopList;
for (DfClassificationTop classificationTop : classificationTopList) {
final String classificationName = classificationTop.getClassificationName();
final String relatedColumnName = classificationTop.getRelatedColumnName();
if (relatedColumnName == null) {
continue;
}
// both callback to keep process order
_allColumnClsSetupper.process();
final Map<String, String> allColumnClassificationMap = allColumnClassificationMapProvider.get();
if (allColumnClassificationMap.containsKey(relatedColumnName)) {
continue;
}
allColumnClassificationMap.put(relatedColumnName, classificationName);
}
}
Aggregations