Class TableUpgrader
- java.lang.Object
-
- 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TableUpgrader.TableUpgrade
-
Field Summary
Fields Modifier and Type Field Description protected List<TableUpgrader.TableUpgrade>
tableUpgrades
-
Constructor Summary
Constructors Constructor Description TableUpgrader(SQLInfo sqlInfo, Connection connection, JDBCLogger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, String ddlMode, SQLStatement.ListCollector ddlCollector)
Check if there is an added column that match with a upgrade process.
-
-
-
Field Detail
-
tableUpgrades
protected List<TableUpgrader.TableUpgrade> tableUpgrades
-
-
Constructor Detail
-
TableUpgrader
public TableUpgrader(SQLInfo sqlInfo, Connection connection, JDBCLogger logger)
-
-
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 namecolumnName
- desired added columnsqlProcedure
- sql procedure nametestProp
- 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.- Parameters:
tableKey
- table nameaddedColumns
- list of added column- Throws:
SQLException
- Exception thrown by JDBC
-
-