Class DDLCreator
java.lang.Object
net.sf.jailer.ddl.DDLCreator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateDDL(DataSource dataSource, DBMS dbms, WorkingTableScope temporaryTableScope, String workingTableSchema) Creates the DDL for the working-tables.voidcreateDDL(Session localSession, WorkingTableScope temporaryTableScope, String workingTableSchema) Creates the DDL for the working-tables.booleancreateDDL(DataModel datamodel, Session session, WorkingTableScope temporaryTableScope, String workingTableSchema) Creates the DDL for the working-tables.booleancreateDDL(DataModel datamodel, Session session, WorkingTableScope temporaryTableScope, RowIdSupport rowIdSupport, String workingTableSchema) Creates the DDL for the working-tables.getTableInConflict(DataSource dataSource, DBMS dbms) Checks for conflicts of existing tables and working-tables.booleanisUptodate(DataSource dataSource, DBMS dbms, boolean useRowId, boolean useRowIdsOnlyForTablesWithoutPK, String workingTableSchema) Checks whether working-tables schema is up-to-date.booleanisUptodate(Session session, boolean useRowId, boolean useRowIdsOnlyForTablesWithoutPK, String workingTableSchema) Checks whether working-tables schema is up-to-date.
-
Field Details
-
uPKWasTooLong
public static volatile boolean uPKWasTooLong -
uPK
-
lastDDL
-
-
Constructor Details
-
DDLCreator
Constructor.- Parameters:
executionContext- the execution context
-
-
Method Details
-
createDDL
public boolean createDDL(DataSource dataSource, DBMS dbms, WorkingTableScope temporaryTableScope, String workingTableSchema) throws SQLException, FileNotFoundException, IOException Creates the DDL for the working-tables.- Parameters:
dataSource- the data source, ornullto print DDL to stdoutdbms- the target DBMS configurationtemporaryTableScope- the scope for working tablesworkingTableSchema- the schema for working tables, ornullfor the default schema- Returns:
trueif DDL was created successfully- Throws:
SQLExceptionFileNotFoundExceptionIOException
-
createDDL
public void createDDL(Session localSession, WorkingTableScope temporaryTableScope, String workingTableSchema) throws FileNotFoundException, IOException, SQLException Creates the DDL for the working-tables.- Parameters:
localSession- the database session to execute DDL againsttemporaryTableScope- the scope for working tablesworkingTableSchema- the schema for working tables, ornullfor the default schema- Throws:
FileNotFoundExceptionIOExceptionSQLException
-
createDDL
public boolean createDDL(DataModel datamodel, Session session, WorkingTableScope temporaryTableScope, String workingTableSchema) throws FileNotFoundException, IOException, SQLException Creates the DDL for the working-tables.- Parameters:
datamodel- the data modelsession- the database session, ornullto print DDL to stdouttemporaryTableScope- the scope for working tablesworkingTableSchema- the schema for working tables, ornullfor the default schema- Returns:
trueif DDL was created successfully- Throws:
FileNotFoundExceptionIOExceptionSQLException
-
createDDL
public boolean createDDL(DataModel datamodel, Session session, WorkingTableScope temporaryTableScope, RowIdSupport rowIdSupport, String workingTableSchema) throws FileNotFoundException, IOException, SQLException Creates the DDL for the working-tables.- Parameters:
datamodel- the data modelsession- the database session, ornullto print DDL to stdouttemporaryTableScope- the scope for working tablesrowIdSupport- the row-id support configurationworkingTableSchema- the schema for working tables, ornullfor the default schema- Returns:
trueif DDL was created successfully- Throws:
FileNotFoundExceptionIOExceptionSQLException
-
isUptodate
public boolean isUptodate(DataSource dataSource, DBMS dbms, boolean useRowId, boolean useRowIdsOnlyForTablesWithoutPK, String workingTableSchema) Checks whether working-tables schema is up-to-date.- Parameters:
dataSource- the data sourcedbms- the target DBMS configurationuseRowId-trueif row IDs are used instead of primary keysuseRowIdsOnlyForTablesWithoutPK-trueto use row IDs only for tables without a primary keyworkingTableSchema- the schema for working tables, ornullfor the default schema- Returns:
trueif working-tables schema is up-to-date
-
isUptodate
public boolean isUptodate(Session session, boolean useRowId, boolean useRowIdsOnlyForTablesWithoutPK, String workingTableSchema) Checks whether working-tables schema is up-to-date.- Parameters:
session- the database sessionuseRowId-trueif row IDs are used instead of primary keysuseRowIdsOnlyForTablesWithoutPK-trueto use row IDs only for tables without a primary keyworkingTableSchema- the schema for working tables, ornullfor the default schema- Returns:
trueif working-tables schema is up-to-date
-
getTableInConflict
Checks for conflicts of existing tables and working-tables.- Parameters:
dataSource- the data sourcedbms- the target DBMS configuration- Returns:
- name of table in conflict or
null
-