Search in sources :

Example 1 with DfRepsSequenceHandlerFactory

use of org.dbflute.logic.replaceschema.takefinally.sequence.factory.DfRepsSequenceHandlerFactory 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)

Aggregations

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