/** * Build the database structure. * * @param type The Hibernate type of the identifier property * @param params The params supplied in the generator config (plus some standard useful extras). * @param jdbcEnvironment The JDBC environment in which the sequence will be used. * @param forceTableUse Should a table be used even if the dialect supports sequences? * @param sequenceName The name to use for the sequence or table. * @param initialValue The initial value. * @param incrementSize the increment size to use (after any adjustments). * * @return An abstraction for the actual database structure in use (table vs. sequence). */ @SuppressWarnings("WeakerAccess") protected DatabaseStructure buildDatabaseStructure( Type type, Properties params, JdbcEnvironment jdbcEnvironment, boolean forceTableUse, QualifiedName sequenceName, int initialValue, int incrementSize) { if ( isPhysicalSequence( jdbcEnvironment, forceTableUse ) ) { return buildSequenceStructure( type, params, jdbcEnvironment, sequenceName, initialValue, incrementSize ); } else { return buildTableStructure( type, params, jdbcEnvironment, sequenceName, initialValue, incrementSize ); } }
int incrementSize = determineIncrementSize( params ); if ( isPhysicalSequence( jdbcEnvironment, forceTableUse ) ) { String databaseSequenceName = sequenceName.getObjectName().getText(); Long databaseIncrementValue = getSequenceIncrementValue( jdbcEnvironment, databaseSequenceName );
/** * Build the database structure. * * @param javaTypeDescriptor The java type descriptor of the identifier property * @param params The params supplied in the generator config (plus some standard useful extras). * @param jdbcEnvironment The JDBC environment in which the sequence will be used. * @param forceTableUse Should a table be used even if the dialect supports sequences? * @param sequenceName The name to use for the sequence or table. * @param initialValue The initial value. * @param incrementSize the increment size to use (after any adjustments). * * @return An abstraction for the actual database structure in use (table vs. sequence). */ @SuppressWarnings("WeakerAccess") protected DatabaseStructure buildDatabaseStructure( JavaTypeDescriptor javaTypeDescriptor, Properties params, JdbcEnvironment jdbcEnvironment, boolean forceTableUse, QualifiedName sequenceName, int initialValue, int incrementSize) { if ( isPhysicalSequence( jdbcEnvironment, forceTableUse ) ) { return buildSequenceStructure( javaTypeDescriptor, params, jdbcEnvironment, sequenceName, initialValue, incrementSize ); } else { return buildTableStructure( javaTypeDescriptor, params, jdbcEnvironment, sequenceName, initialValue, incrementSize ); } }
int incrementSize = determineIncrementSize( params ); if ( isPhysicalSequence( jdbcEnvironment, forceTableUse ) ) { String databaseSequenceName = sequenceName.getObjectName().getText(); Long databaseIncrementValue = getSequenceIncrementValue( jdbcEnvironment, databaseSequenceName );