Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.storage.sql.jdbc
Class TableUpgrader

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.jdbc.TableUpgrader

public class TableUpgrader
extends Object

Helper to provide SQL migration calls while adding a column.

Since:
5.4.2

Constructor Summary
TableUpgrader(JDBCMapper mapper)
           
 
Method Summary
 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.
 void upgrade(String tableKey, List<Column> addedColumns)
          Check if there is an added column that match with a upgrade process.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableUpgrader

public TableUpgrader(JDBCMapper mapper)
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.

Parameters:
tableKey - table name
columnName - desired added column
sqlProcedure - sql procedure name
testProp - test flag name

upgrade

public void upgrade(String tableKey,
                    List<Column> addedColumns)
             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.

Parameters:
tableKey - table name
addedColumns - list of added column
Throws:
SQLException - Exception thrown by JDBC

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.