Class TableUpgrader

  • public class TableUpgrader
    extends Object
    Helper to provide SQL migration calls while adding a column.
    • Method Detail

      • add

        public void add​(String tableKey,
                        String columnName,
                        String sqlProcedure,
                        String testProp)
        Add a couple table/column associated with a sql procedure to be executed when the column is added and a a test flag to force his execution.
        tableKey - table name
        columnName - desired added column
        sqlProcedure - sql procedure name
        testProp - test flag name
      • upgrade

        public void upgrade​(String tableKey,
                            List<Column> addedColumns,
                            String ddlMode,
                            SQLStatement.ListCollector ddlCollector)
                     throws SQLException
        Check if there is an added column that match with a upgrade process. If one exists, it executes the associated sql in the category. If not, nothing happend.
        tableKey - table name
        addedColumns - list of added column
        SQLException - Exception thrown by JDBC