Top Description Fields Constructors Methods
liquibase.snapshot.jvm

public Class ColumnAutoIncrementService

extends Object
Class Inheritance
Imports
liquibase.Scope, liquibase.database.Database, liquibase.database.core.MSSQLDatabase, .OracleDatabase, .PostgresDatabase, liquibase.database.jvm.JdbcConnection, liquibase.exception.DatabaseException, .LiquibaseException, .UnexpectedLiquibaseException, liquibase.executor.Executor, .ExecutorService, liquibase.snapshot.CachedRow, .DatabaseSnapshot, liquibase.statement.core.RawSqlStatement, liquibase.structure.core.Column, .Schema, liquibase.util.StringUtil, java.sql.Connection, .ResultSet, .SQLException, .Statement, java.util.List, .Map, java.util.concurrent.ConcurrentHashMap

Service class that centralizes database specific auto increment parameters information.

Field Summary

Modifier and TypeField and Description
private Map<String, Column.AutoIncrementInformation>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Column
enableColumnAutoIncrementIfAvailable(Column column, Database database, CachedRow columnMetadataResultSet, String rawCatalogName, String rawSchemaName, String rawTableName, String rawColumnName)

Verify if a column has auto increment capabilities and set the autoIncrement field with a placeholder object (starts with 1, increment 1)

private String
private void
handleEnableAutoIncrementForOracle(Column column, CachedRow columnMetadataResultSet)

private void
handleEnableAutoIncrementValidation(Column column, Database database, CachedRow columnMetadataResultSet)

private void
handleEnableAutoIncrementValidationLegacyJdbc(Column column, Database database, String rawCatalogName, String rawSchemaName, String rawTableName, String rawColumnName)

public Map<String, Column.AutoIncrementInformation>

Returns:

Map with the sequence name and auto increment details
obtainSequencesInformation
(Database
the database connection
database
,
Schema schema, DatabaseSnapshot
snapshot data used to store cache information.
snapshot
)

If the database support autoincrement columns details (as starts with and increment by), this method returns the detailed information about them.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

autoIncrementColumnsback to summary
private Map<String, Column.AutoIncrementInformation> autoIncrementColumns

Constructor Detail

ColumnAutoIncrementServiceback to summary
public ColumnAutoIncrementService()

Method Detail

enableColumnAutoIncrementIfAvailableback to summary
public Column enableColumnAutoIncrementIfAvailable(Column column, Database database, CachedRow columnMetadataResultSet, String rawCatalogName, String rawSchemaName, String rawTableName, String rawColumnName) throws SQLException

Verify if a column has auto increment capabilities and set the autoIncrement field with a placeholder object (starts with 1, increment 1)

getQueryForDatabaseAndSchemaback to summary
private String getQueryForDatabaseAndSchema(Database database, Schema schema) throws LiquibaseException
handleEnableAutoIncrementForOracleback to summary
private void handleEnableAutoIncrementForOracle(Column column, CachedRow columnMetadataResultSet)
handleEnableAutoIncrementValidationback to summary
private void handleEnableAutoIncrementValidation(Column column, Database database, CachedRow columnMetadataResultSet)
handleEnableAutoIncrementValidationLegacyJdbcback to summary
private void handleEnableAutoIncrementValidationLegacyJdbc(Column column, Database database, String rawCatalogName, String rawSchemaName, String rawTableName, String rawColumnName) throws SQLException
obtainSequencesInformationback to summary
public Map<String, Column.AutoIncrementInformation> obtainSequencesInformation(Database database, Schema schema, DatabaseSnapshot snapshot)

If the database support autoincrement columns details (as starts with and increment by), this method returns the detailed information about them. If a new database needs to be supported just add the query to method getQueryForDatabase .

Parameters
database:Database

the database connection

snapshot:DatabaseSnapshot

snapshot data used to store cache information.

Returns:Map<String, Column.AutoIncrementInformation>

Map with the sequence name and auto increment details