use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class DfProcedureExtractor method isSynonymAllowedSchema.
protected boolean isSynonymAllowedSchema(DfProcedureSynonymMeta procedureSynonymMetaInfo) {
final DfSynonymMeta synonymMetaInfo = procedureSynonymMetaInfo.getSynonymMetaInfo();
final UnifiedSchema synonymOwner = synonymMetaInfo.getSynonymOwner();
final DfDatabaseProperties databaseProperties = getProperties().getDatabaseProperties();
final DfAdditionalSchemaInfo additionalSchemaInfo = databaseProperties.getAdditionalSchemaInfo(synonymOwner);
if (additionalSchemaInfo != null) {
return additionalSchemaInfo.hasObjectTypeSynonym();
} else {
// as main schema
return databaseProperties.hasObjectTypeSynonym();
}
}
use of org.dbflute.properties.DfDatabaseProperties 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;
}
use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class DfTakeFinallyProcess method incrementSequenceToDataMax.
// -----------------------------------------------------
// Increment Sequence
// ------------------
protected void incrementSequenceToDataMax() {
if (!getReplaceSchemaProperties().isIncrementSequenceToDataMax()) {
return;
}
if (_suppressSequenceIncrement) {
return;
}
_log.info("");
_log.info("* * * * * * * * * * **");
_log.info("* *");
_log.info("* Increment Sequence *");
_log.info("* *");
_log.info("* * * * * * * * * * **");
final DfSequenceIdentityProperties sequenceProp = getProperties().getSequenceIdentityProperties();
final Map<String, String> tableSequenceMap = sequenceProp.getTableSequenceMap();
final DfDatabaseTypeFacadeProp dbTypeProp = getDatabaseTypeFacadeProp();
final DfDatabaseProperties databaseProp = getDatabaseProperties();
final DfSequenceHandlerFactory factory = new DfSequenceHandlerFactory(_dataSource, dbTypeProp, databaseProp);
final DfSequenceHandler sequenceHandler = factory.createSequenceHandler();
if (sequenceHandler == null) {
String databaseType = dbTypeProp.getTargetDatabase();
String msg = "Unsupported isIncrementSequenceToDataMax at " + databaseType;
throw new UnsupportedOperationException(msg);
}
sequenceHandler.incrementSequenceToDataMax(tableSequenceMap);
}
use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class DfSchemaXmlSerializer method createSequenceExtractorFactory.
protected DfSequenceExtractorFactory createSequenceExtractorFactory(DfSchemaSource dataSource) {
final DfDatabaseTypeFacadeProp facadeProp = getProperties().getBasicProperties().getDatabaseTypeFacadeProp();
final DfDatabaseProperties databaseProp = getDatabaseProperties();
final DfSequenceExtractorFactory factory = new DfSequenceExtractorFactory(dataSource, facadeProp, databaseProp);
if (_suppressAdditionalSchema) {
factory.suppressAdditionalSchema();
}
return factory;
}
Aggregations