use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class Table method doHasAllCommonColumn.
protected boolean doHasAllCommonColumn() {
if (isAdditionalSchema()) {
final DfDatabaseProperties prop = getDatabaseProperties();
final DfAdditionalSchemaInfo schemaInfo = prop.getAdditionalSchemaInfo(_unifiedSchema);
if (schemaInfo.isSuppressCommonColumn()) {
return false;
}
}
final List<String> commonColumnNameList = getCommonColumnProperties().getCommonColumnNameList();
if (commonColumnNameList.isEmpty()) {
return false;
}
for (String commonColumnName : commonColumnNameList) {
if (getCommonColumnProperties().isCommonColumnConversion(commonColumnName)) {
final Column col = findMyCommonColumn(commonColumnName);
if (col == null) {
return false;
}
} else {
if (!_columnMap.containsKey(commonColumnName)) {
return false;
}
}
}
return true;
}
use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class UnifiedSchema method judgeSchema.
protected UnifiedSchema judgeSchema() {
final DfDatabaseProperties databaseProp = getDatabaseProperties();
final UnifiedSchema mainSchema = databaseProp.getDatabaseSchema();
if (equals(mainSchema)) {
asMainSchema();
} else {
final DfAdditionalSchemaInfo info = databaseProp.getAdditionalSchemaInfo(this);
if (info != null) {
asAdditionalSchema();
if (info.getUnifiedSchema().isCatalogAdditionalSchema()) {
asCatalogAdditionalSchema();
}
} else {
asUnknownSchema();
}
}
return this;
}
use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class DfCraftDiffAssertSqlFire method createRunnerInformation.
// ===================================================================================
// Runner Information
// ==================
protected DfRunnerInformation createRunnerInformation() {
final DfRunnerInformation runInfo = new DfRunnerInformation();
final DfDatabaseProperties prop = getDatabaseProperties();
runInfo.setDriver(prop.getDatabaseDriver());
runInfo.setUrl(prop.getDatabaseUrl());
runInfo.setUser(prop.getDatabaseUser());
runInfo.setPassword(prop.getDatabasePassword());
runInfo.setEncoding(getSqlFileEncoding());
runInfo.setBreakCauseThrow(true);
runInfo.setErrorContinue(false);
runInfo.setAutoCommit(false);
runInfo.setRollbackOnly(true);
runInfo.setSuppressLoggingSql(false);
return runInfo;
}
use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class DfAbstractReplaceSchemaProcess method createRunnerInformation.
// ===================================================================================
// SQL File Runner
// ===============
protected DfRunnerInformation createRunnerInformation() {
final DfRunnerInformation runInfo = new DfRunnerInformation();
final DfDatabaseProperties prop = getDatabaseProperties();
runInfo.setDriver(prop.getDatabaseDriver());
runInfo.setUrl(prop.getDatabaseUrl());
runInfo.setUser(prop.getDatabaseUser());
runInfo.setPassword(prop.getDatabasePassword());
runInfo.setEncoding(getSqlFileEncoding());
// save break cause to prepare messages
runInfo.setBreakCauseThrow(false);
runInfo.setErrorContinue(isErrorContinue());
if (isRollbackTransaction()) {
// basically take-assert
runInfo.setAutoCommit(false);
runInfo.setRollbackOnly(true);
} else {
// mainly here
runInfo.setAutoCommit(true);
runInfo.setRollbackOnly(false);
}
runInfo.setSuppressLoggingSql(isSuppressLoggingReplaceSql());
// use delimiter from ReplaceSchema properties
runInfo.setDelimiter(getSqlDelimiter());
return runInfo;
}
use of org.dbflute.properties.DfDatabaseProperties in project dbflute-core by dbflute.
the class DfProcedureExtractor method setupAdditionalSchemaProcedure.
// -----------------------------------------------------
// Additional Schema
// -----------------
protected void setupAdditionalSchemaProcedure(DfSchemaSource dataSource, List<DfProcedureMeta> procedureList) throws SQLException {
if (_suppressAdditionalSchema) {
return;
}
final DfDatabaseProperties databaseProp = getProperties().getDatabaseProperties();
final List<UnifiedSchema> additionalSchemaList = databaseProp.getAdditionalSchemaList();
for (UnifiedSchema additionalSchema : additionalSchemaList) {
final DfAdditionalSchemaInfo schemaInfo = databaseProp.getAdditionalSchemaInfo(additionalSchema);
if (schemaInfo.isSuppressProcedure()) {
continue;
}
final List<DfProcedureMeta> additionalProcedureList = getPlainProcedureList(dataSource, additionalSchema);
procedureList.addAll(additionalProcedureList);
}
}
Aggregations