クラス DbVersionHandler

java.lang.Object
com.sqlapp.data.db.command.version.DbVersionHandler

public class DbVersionHandler extends Object
  • フィールド詳細

  • コンストラクタの詳細

    • DbVersionHandler

      public DbVersionHandler()
  • メソッドの詳細

    • getIdColumnName

      public String getIdColumnName()
      戻り値:
      the idColumnName
    • setIdColumnName

      public void setIdColumnName(String idColumnName)
      パラメータ:
      idColumnName - the idColumnName to set
    • getAppliedByColumnName

      public String getAppliedByColumnName()
      戻り値:
      the appliedByColumnName
    • setAppliedByColumnName

      public void setAppliedByColumnName(String appliedByColumnName)
      パラメータ:
      appliedByColumnName - the appliedByColumnName to set
    • getAppliedAtColumnName

      public String getAppliedAtColumnName()
      戻り値:
      the appliedAtColumnName
    • setAppliedAtColumnName

      public void setAppliedAtColumnName(String appliedAtColumnName)
      パラメータ:
      appliedAtColumnName - the appliedAtColumnName to set
    • getStatusColumnName

      public String getStatusColumnName()
      戻り値:
      the statusColumnName
    • setStatusColumnName

      public void setStatusColumnName(String statusColumnName)
      パラメータ:
      statusColumnName - the statusColumnName to set
    • getDescriptionColumnName

      public String getDescriptionColumnName()
      戻り値:
      the descriptionColumnName
    • setDescriptionColumnName

      public void setDescriptionColumnName(String descriptionColumnName)
      パラメータ:
      descriptionColumnName - the descriptionColumnName to set
    • getSeriesNumberColumnName

      public String getSeriesNumberColumnName()
      戻り値:
      the seriesNumberColumnName
    • setSeriesNumberColumnName

      public void setSeriesNumberColumnName(String seriesNumberColumnName)
      パラメータ:
      seriesNumberColumnName - the seriesNumberColumnName to set
    • createVersionTableDefinition

      public com.sqlapp.data.schemas.Table createVersionTableDefinition(String name)
      名前を指定してバージョン管理テーブルを取得します。
      パラメータ:
      name - 名前
      戻り値:
      バージョン管理テーブル定義
    • mergeSqlFiles

      public void mergeSqlFiles(List<DbVersionFileHandler.SqlFile> sqlFiles, com.sqlapp.data.schemas.Table table)
    • getId

      protected Long getId(com.sqlapp.data.schemas.Row row)
    • getAppliedAt

      protected Date getAppliedAt(com.sqlapp.data.schemas.Row row)
    • getStatus

      protected Status getStatus(com.sqlapp.data.schemas.Row row)
    • getSeriesNumber

      protected Long getSeriesNumber(com.sqlapp.data.schemas.Row row)
    • getDescription

      protected String getDescription(com.sqlapp.data.schemas.Row row)
    • append

      public void append(com.sqlapp.data.schemas.Table table, com.sqlapp.util.OutputTextBuilder builder)
    • createVersionTableDefinition

      public com.sqlapp.data.schemas.Table createVersionTableDefinition()
      デフォルトの名前でバージョン管理テーブル定義を作成します。
      戻り値:
      バージョン管理テーブル定義
    • getLastApplied

      public Long getLastApplied(com.sqlapp.data.schemas.Table table)
    • markCurrentVersion

      public com.sqlapp.data.schemas.Row markCurrentVersion(com.sqlapp.data.schemas.Table table)
    • getRowsForVersionUp

      public List<com.sqlapp.data.schemas.Row> getRowsForVersionUp(com.sqlapp.data.schemas.Table table, Long version)
    • getRowsForVersionDown

      public List<com.sqlapp.data.schemas.Row> getRowsForVersionDown(com.sqlapp.data.schemas.Table table, Long version)
      最後に適用されたバージョンを返します。
      パラメータ:
      table - バージョン管理テーブル
      version - バージョン
      戻り値:
      最後に適用されたバージョン
    • getRowsForVersionMerge

      public List<com.sqlapp.data.schemas.Row> getRowsForVersionMerge(com.sqlapp.data.schemas.Table table, List<DbVersionFileHandler.SqlFile> sqlFiles)
      Merge用のバージョンを返します。
      パラメータ:
      table - バージョン管理テーブル
      sqlFiles - 対象のSQL
      戻り値:
      未適用のバージョン
    • getRowsForVersionRepair

      public com.sqlapp.data.schemas.Row getRowsForVersionRepair(com.sqlapp.data.schemas.Table table)
      Repair対象バージョンを返します。
      パラメータ:
      table - バージョン管理テーブル
      戻り値:
      Repair対象バージョン
    • exists

      public boolean exists(com.sqlapp.data.db.dialect.Dialect dialect, Connection connection, com.sqlapp.data.schemas.Table table, Long id) throws SQLException
      例外:
      SQLException
    • exists

      public void exists(com.sqlapp.data.db.dialect.Dialect dialect, Connection connection, com.sqlapp.data.schemas.Table table, Long id, Consumer<com.sqlapp.jdbc.ExResultSet> cons) throws SQLException
      例外:
      SQLException
    • getRowsForVersionDownSeries

      public List<com.sqlapp.data.schemas.Row> getRowsForVersionDownSeries(com.sqlapp.data.schemas.Table table)
      一括適用されたバージョンを返します。
      パラメータ:
      table - バージョン管理テーブル
      戻り値:
      一括適用されたバージョン
    • getTable

      protected com.sqlapp.data.schemas.Table getTable(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table) throws SQLException
      例外:
      SQLException
    • createTable

      public boolean createTable(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table) throws SQLException
      例外:
      SQLException
    • dropTable

      public boolean dropTable(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table) throws SQLException
      例外:
      SQLException
    • load

      public void load(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table) throws SQLException
      例外:
      SQLException
    • insertVersion

      public int insertVersion(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table, com.sqlapp.data.schemas.Row row, Long seriesNumber, Status status) throws SQLException
      例外:
      SQLException
    • updateVersion

      public int updateVersion(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table, com.sqlapp.data.schemas.Row row, Long id, Status from, Status to) throws SQLException
      例外:
      SQLException
    • deleteVersion

      public int deleteVersion(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table, com.sqlapp.data.schemas.Row row) throws SQLException
      例外:
      SQLException
    • deleteVersion

      public int deleteVersion(Connection connection, com.sqlapp.data.db.dialect.Dialect dialect, com.sqlapp.data.schemas.Table table, long id) throws SQLException
      例外:
      SQLException
    • getSchemaChangeLogTableName

      public String getSchemaChangeLogTableName()
      戻り値:
      the schemaChangeLogTableName
    • setSchemaChangeLogTableName

      public void setSchemaChangeLogTableName(String schemaChangeLogTableName)
      パラメータ:
      schemaChangeLogTableName - the schemaChangeLogTableName to set
    • isWithSeriesNumber

      public boolean isWithSeriesNumber()
      戻り値:
      the withSeriesNumber
    • setWithSeriesNumber

      public void setWithSeriesNumber(boolean withSeriesNumber)
      パラメータ:
      withSeriesNumber - the withSeriesNumber to set