use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method doHelpTableDatePrecision.
protected void doHelpTableDatePrecision(List<DfTableMeta> tableList, UnifiedSchema unifiedSchema) {
final DfDatetimePrecisionExtractor datetimePrecisionExtractor = createDatetimePrecisionExtractor(unifiedSchema);
if (datetimePrecisionExtractor != null) {
final Set<String> tableSet = new HashSet<String>();
for (DfTableMeta table : tableList) {
tableSet.add(table.getTableName());
}
try {
if (_datetimePrecisionAllMap == null) {
_datetimePrecisionAllMap = new LinkedHashMap<UnifiedSchema, Map<String, Map<String, Integer>>>();
}
final Map<String, Map<String, Integer>> datetimePrecisionMap = _datetimePrecisionAllMap.get(unifiedSchema);
final Map<String, Map<String, Integer>> extractedMap = datetimePrecisionExtractor.extractDatetimePrecisionMap(tableSet);
if (datetimePrecisionMap == null) {
_datetimePrecisionAllMap.put(unifiedSchema, extractedMap);
} else {
// basically no way, schema is unique but just in case
// merge
datetimePrecisionMap.putAll(extractedMap);
}
} catch (RuntimeException continued) {
_log.info("Failed to extract date-time precisions: extractor=" + datetimePrecisionExtractor, continued);
}
}
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfTaskControlLogic method connectMainSchema.
protected void connectMainSchema(Connection conn) throws SQLException {
final UnifiedSchema mainSchema = _databaseResource.getMainSchema();
final DfCurrentSchemaConnector connector = new DfCurrentSchemaConnector(mainSchema, getDatabaseTypeFacadeProp());
connector.connectSchema(conn);
}
use of org.apache.torque.engine.database.model.UnifiedSchema in project dbflute-core by dbflute.
the class DfTaskControlLogic method buildAdditionalSchemaDisp.
protected String buildAdditionalSchemaDisp() {
final DfDatabaseProperties databaseProp = getDatabaseProperties();
final List<UnifiedSchema> additionalSchemaList = databaseProp.getAdditionalSchemaList();
String disp;
if (additionalSchemaList.size() == 1) {
final UnifiedSchema unifiedSchema = additionalSchemaList.get(0);
final String identifiedSchema = unifiedSchema.getIdentifiedSchema();
disp = identifiedSchema;
if (unifiedSchema.isCatalogAdditionalSchema()) {
disp = disp + "(catalog)";
} else if (unifiedSchema.isMainSchema()) {
// should NOT be true
disp = disp + "(main)";
} else if (unifiedSchema.isUnknownSchema()) {
// should NOT be true
disp = disp + "(unknown)";
}
} else {
final StringBuilder sb = new StringBuilder();
for (UnifiedSchema unifiedSchema : additionalSchemaList) {
if (sb.length() > 0) {
sb.append(", ");
}
final String identifiedSchema = unifiedSchema.getIdentifiedSchema();
sb.append(identifiedSchema);
if (unifiedSchema.isCatalogAdditionalSchema()) {
sb.append("(catalog)");
} else if (unifiedSchema.isMainSchema()) {
// should NOT be true
sb.append("(main)");
} else if (unifiedSchema.isUnknownSchema()) {
// should NOT be true
sb.append("(unknown)");
}
}
disp = sb.toString();
}
return disp;
}
Aggregations