Class ColumnAutoIncrementService

java.lang.Object
liquibase.snapshot.jvm.ColumnAutoIncrementService

public class ColumnAutoIncrementService extends Object
Service class that centralizes database specific auto increment parameters information.
  • Constructor Details

    • ColumnAutoIncrementService

      public ColumnAutoIncrementService()
  • Method Details

    • obtainSequencesInformation

      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 - the database connection
      snapshot - snapshot data used to store cache information.
      Returns:
      Map with the sequence name and auto increment details
    • enableColumnAutoIncrementIfAvailable

      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)
      Throws:
      SQLException