Search in sources :

Example 1 with DfSequenceHandler

use of org.dbflute.logic.replaceschema.takefinally.sequence.DfSequenceHandler 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);
}
Also used : DfSequenceHandler(org.dbflute.logic.replaceschema.takefinally.sequence.DfSequenceHandler) DfSequenceHandlerFactory(org.dbflute.logic.replaceschema.takefinally.sequence.factory.DfSequenceHandlerFactory) DfDatabaseTypeFacadeProp(org.dbflute.properties.facade.DfDatabaseTypeFacadeProp) DfSequenceIdentityProperties(org.dbflute.properties.DfSequenceIdentityProperties) DfDatabaseProperties(org.dbflute.properties.DfDatabaseProperties)

Aggregations

DfSequenceHandler (org.dbflute.logic.replaceschema.takefinally.sequence.DfSequenceHandler)1 DfSequenceHandlerFactory (org.dbflute.logic.replaceschema.takefinally.sequence.factory.DfSequenceHandlerFactory)1 DfDatabaseProperties (org.dbflute.properties.DfDatabaseProperties)1 DfSequenceIdentityProperties (org.dbflute.properties.DfSequenceIdentityProperties)1 DfDatabaseTypeFacadeProp (org.dbflute.properties.facade.DfDatabaseTypeFacadeProp)1