Search in sources :

Example 1 with DfDatabaseProperties

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;
}
Also used : DfAdditionalSchemaInfo(org.dbflute.properties.assistant.DfAdditionalSchemaInfo) DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties)

Example 2 with DfDatabaseProperties

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;
}
Also used : DfAdditionalSchemaInfo(org.dbflute.properties.assistant.DfAdditionalSchemaInfo) DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties)

Example 3 with DfDatabaseProperties

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;
}
Also used : DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties) DfRunnerInformation(org.dbflute.helper.jdbc.DfRunnerInformation)

Example 4 with DfDatabaseProperties

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;
}
Also used : DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties) DfRunnerInformation(org.dbflute.helper.jdbc.DfRunnerInformation)

Example 5 with DfDatabaseProperties

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);
    }
}
Also used : DfAdditionalSchemaInfo(org.dbflute.properties.assistant.DfAdditionalSchemaInfo) UnifiedSchema(org.apache.torque.engine.database.model.UnifiedSchema) DfProcedureMeta(org.dbflute.logic.jdbc.metadata.info.DfProcedureMeta) DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties)

Aggregations

DfDatabaseProperties (org.dbflute.properties.DfDatabaseProperties)9 DfAdditionalSchemaInfo (org.dbflute.properties.assistant.DfAdditionalSchemaInfo)4 UnifiedSchema (org.apache.torque.engine.database.model.UnifiedSchema)3 DfRunnerInformation (org.dbflute.helper.jdbc.DfRunnerInformation)2 DfDatabaseTypeFacadeProp (org.dbflute.properties.facade.DfDatabaseTypeFacadeProp)2 DfProcedureMeta (org.dbflute.logic.jdbc.metadata.info.DfProcedureMeta)1 DfSynonymMeta (org.dbflute.logic.jdbc.metadata.info.DfSynonymMeta)1 DfSequenceExtractorFactory (org.dbflute.logic.jdbc.metadata.sequence.factory.DfSequenceExtractorFactory)1 DfSequenceHandler (org.dbflute.logic.replaceschema.takefinally.sequence.DfSequenceHandler)1 DfSequenceHandlerFactory (org.dbflute.logic.replaceschema.takefinally.sequence.factory.DfSequenceHandlerFactory)1 DfSequenceIdentityProperties (org.dbflute.properties.DfSequenceIdentityProperties)1