Search in sources :

Example 1 with DfDatabaseTypeFacadeProp

use of org.dbflute.properties.facade.DfDatabaseTypeFacadeProp in project dbflute-core by dbflute.

the class DfAbstractHelperProperties method setupConnectionVariousSetting.

private void setupConnectionVariousSetting(UnifiedSchema unifiedSchema, Connection conn) throws SQLException {
    conn.setAutoCommit(true);
    if (unifiedSchema.existsPureSchema()) {
        final DfDatabaseTypeFacadeProp facadeProp = getBasicProperties().getDatabaseTypeFacadeProp();
        final DfCurrentSchemaConnector connector = new DfCurrentSchemaConnector(unifiedSchema, facadeProp);
        connector.connectSchema(conn);
    }
}
Also used : DfCurrentSchemaConnector(org.dbflute.logic.jdbc.connection.DfCurrentSchemaConnector) DfDatabaseTypeFacadeProp(org.dbflute.properties.facade.DfDatabaseTypeFacadeProp)

Example 2 with DfDatabaseTypeFacadeProp

use of org.dbflute.properties.facade.DfDatabaseTypeFacadeProp in project dbflute-core by dbflute.

the class AppData method createAsEmpty.

public static AppData createAsEmpty() {
    // e.g. ReplaceSchema's generation
    final DfBasicProperties basicProp = DfBuildProperties.getInstance().getBasicProperties();
    final DfDatabaseTypeFacadeProp facadeProp = basicProp.getDatabaseTypeFacadeProp();
    final String databaseType = facadeProp.getTargetDatabase();
    final AppData appData = new AppData(databaseType);
    final Database database = new Database();
    database.setAppData(appData);
    appData.addDatabase(database);
    return appData;
}
Also used : DfDatabaseTypeFacadeProp(org.dbflute.properties.facade.DfDatabaseTypeFacadeProp) DfBasicProperties(org.dbflute.properties.DfBasicProperties)

Example 3 with DfDatabaseTypeFacadeProp

use of org.dbflute.properties.facade.DfDatabaseTypeFacadeProp in project dbflute-core by dbflute.

the class DfRepsSequenceIncrementer method incrementSequenceToDataMax.

// ===================================================================================
// Increment Sequence
// ==================
public void incrementSequenceToDataMax() {
    final DfSequenceIdentityProperties sequenceProp = getProperties().getSequenceIdentityProperties();
    final Map<String, String> tableSequenceMap = sequenceProp.getTableSequenceMap();
    final DfDatabaseTypeFacadeProp dbTypeProp = getDatabaseTypeFacadeProp();
    final DfDatabaseProperties databaseProp = getDatabaseProperties();
    final DfRepsSequenceHandlerFactory factory = new DfRepsSequenceHandlerFactory(_dataSource, dbTypeProp, databaseProp);
    final DfRepsSequenceHandler sequenceHandler = factory.createSequenceHandler();
    if (sequenceHandler == null) {
        String databaseType = dbTypeProp.getTargetDatabase();
        String msg = "Unsupported isIncrementSequenceToDataMax at " + databaseType;
        throw new UnsupportedOperationException(msg);
    }
    sequenceHandler.incrementSequenceToDataMax(tableSequenceMap);
}
Also used : DfDatabaseTypeFacadeProp(org.dbflute.properties.facade.DfDatabaseTypeFacadeProp) DfRepsSequenceHandlerFactory(org.dbflute.logic.replaceschema.takefinally.sequence.factory.DfRepsSequenceHandlerFactory) DfSequenceIdentityProperties(org.dbflute.properties.DfSequenceIdentityProperties) DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties)

Example 4 with DfDatabaseTypeFacadeProp

use of org.dbflute.properties.facade.DfDatabaseTypeFacadeProp in project dbflute-core by dbflute.

the class DfIndexExtractor method extractIndexMetaData.

protected ResultSet extractIndexMetaData(DatabaseMetaData metaData, UnifiedSchema unifiedSchema, String tableName, boolean retry) throws SQLException {
    final boolean uniqueKeyOnly = false;
    final DfDatabaseTypeFacadeProp prop = getDatabaseTypeFacadeProp();
    return delegateExtractIndexInfoMetaData(metaData, unifiedSchema, tableName, uniqueKeyOnly, retry, prop);
}
Also used : DfDatabaseTypeFacadeProp(org.dbflute.properties.facade.DfDatabaseTypeFacadeProp)

Example 5 with DfDatabaseTypeFacadeProp

use of org.dbflute.properties.facade.DfDatabaseTypeFacadeProp in project dbflute-core by dbflute.

the class DfAbstractDBFluteProperties method setupConnectionVariousSetting.

private void setupConnectionVariousSetting(UnifiedSchema unifiedSchema, Connection conn) throws SQLException {
    conn.setAutoCommit(true);
    if (unifiedSchema.existsPureSchema()) {
        final DfDatabaseTypeFacadeProp facadeProp = getBasicProperties().getDatabaseTypeFacadeProp();
        final DfCurrentSchemaConnector connector = new DfCurrentSchemaConnector(unifiedSchema, facadeProp);
        connector.connectSchema(conn);
    }
}
Also used : DfCurrentSchemaConnector(org.dbflute.logic.jdbc.connection.DfCurrentSchemaConnector) DfDatabaseTypeFacadeProp(org.dbflute.properties.facade.DfDatabaseTypeFacadeProp)

Aggregations

DfDatabaseTypeFacadeProp (org.dbflute.properties.facade.DfDatabaseTypeFacadeProp)9 DfCurrentSchemaConnector (org.dbflute.logic.jdbc.connection.DfCurrentSchemaConnector)2 DfBasicProperties (org.dbflute.properties.DfBasicProperties)2 DfDatabaseProperties (org.dbflute.properties.DfDatabaseProperties)2 DfSequenceExtractorFactory (org.dbflute.logic.jdbc.metadata.sequence.factory.DfSequenceExtractorFactory)1 DfUniqueKeyFkExtractorFactory (org.dbflute.logic.jdbc.metadata.supplement.factory.DfUniqueKeyFkExtractorFactory)1 DfRepsSequenceHandlerFactory (org.dbflute.logic.replaceschema.takefinally.sequence.factory.DfRepsSequenceHandlerFactory)1 DfSequenceIdentityProperties (org.dbflute.properties.DfSequenceIdentityProperties)1