public interface Platform
| Modifier and Type | Method and Description |
|---|---|
void |
alterModel(Connection connection,
Database currentModel,
Database desiredModel,
boolean continueOnError)
Alters the given live database model so that it match the desired model.
|
void |
alterModel(Connection connection,
Database currentModel,
Database desiredModel,
CreationParameters params,
boolean continueOnError)
Alters the given live database model so that it match the desired model.
|
void |
alterModel(Database currentModel,
Database desiredModel,
boolean continueOnError)
Alters the given live database model so that it match the desired model, using the default database conneciton.
|
void |
alterModel(Database currentModel,
Database desiredModel,
CreationParameters params,
boolean continueOnError)
Alters the given live database model so that it match the desired model, using the default database conneciton.
|
void |
alterTables(Connection connection,
Database desiredDb,
boolean continueOnError)
Deprecated.
Use
alterModel(Connection, Database, Database, boolean) together with
readModelFromDatabase(Connection, String) instead. |
void |
alterTables(Connection connection,
Database desiredDb,
CreationParameters params,
boolean continueOnError)
Deprecated.
Use
alterModel(Connection, Database, Database, CreationParameters, boolean) together with
readModelFromDatabase(Connection, String) instead. |
void |
alterTables(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
boolean continueOnError)
Deprecated.
|
void |
alterTables(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params,
boolean continueOnError)
Deprecated.
|
void |
alterTables(Database desiredDb,
boolean continueOnError)
Deprecated.
Use
alterModel(Database, Database, boolean) together with
readModelFromDatabase(String) instead. |
void |
alterTables(Database desiredDb,
CreationParameters params,
boolean continueOnError)
Deprecated.
Use
alterModel(Database, Database, CreationParameters, boolean) together with
readModelFromDatabase(String) instead. |
void |
alterTables(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
boolean continueOnError)
Deprecated.
Use
alterModel(Database, Database, boolean) together with
readModelFromDatabase(String, String, String, String[]) instead. |
void |
alterTables(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params,
boolean continueOnError)
Deprecated.
|
Connection |
borrowConnection()
Returns a (new) JDBC connection from the data source.
|
void |
createDatabase(String jdbcDriverClassName,
String connectionUrl,
String username,
String password,
Map parameters)
Creates the database specified by the given parameters.
|
void |
createModel(Connection connection,
Database model,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model.
|
void |
createModel(Connection connection,
Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model.
|
void |
createModel(Database model,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model.
|
void |
createModel(Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model.
|
void |
createTables(Connection connection,
Database model,
boolean dropTablesFirst,
boolean continueOnError)
Deprecated.
Use
createModel(Connection, Database, boolean, boolean) instead. |
void |
createTables(Connection connection,
Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Deprecated.
|
void |
createTables(Database model,
boolean dropTablesFirst,
boolean continueOnError)
Deprecated.
Use
createModel(Database, boolean, boolean) instead. |
void |
createTables(Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Deprecated.
|
void |
delete(Connection connection,
Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Deletes the row which maps to the given bean from the database.
|
void |
delete(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Deletes the given bean from the database, assuming the primary key values are specified.
|
void |
dropDatabase(String jdbcDriverClassName,
String connectionUrl,
String username,
String password)
Drops the database specified by the given parameters.
|
void |
dropModel(Connection connection,
Database model,
boolean continueOnError)
Drops the given model.
|
void |
dropModel(Database model,
boolean continueOnError)
Drops the given model using the default database connection.
|
void |
dropTable(Connection connection,
Database model,
Table table,
boolean continueOnError)
Drops the specified table and all foreign keys pointing to it.
|
void |
dropTable(Database model,
Table table,
boolean continueOnError)
Drops the specified table and all foreign keys pointing to it.
|
void |
dropTables(Connection connection,
Database model,
boolean continueOnError)
Deprecated.
Use
dropModel(Connection, Database, boolean) instead. |
void |
dropTables(Database model,
boolean continueOnError)
Deprecated.
Use
dropModel(Database, boolean) instead. |
int |
evaluateBatch(Connection connection,
String sql,
boolean continueOnError)
Executes a series of sql statements which must be seperated by the delimiter
configured as
PlatformInfo.getSqlCommandDelimiter() of the info object
of this platform. |
int |
evaluateBatch(String sql,
boolean continueOnError)
Executes a series of sql statements which must be seperated by the delimiter
configured as
PlatformInfo.getSqlCommandDelimiter() of the info object
of this platform. |
boolean |
exists(Connection connection,
Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Determines whether the given dyna bean is stored in the database.
|
boolean |
exists(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Determines whether the given dyna bean is stored in the database.
|
List |
fetch(Database model,
String sql)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
Collection parameters)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
Collection parameters,
int start,
int end)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
Collection parameters,
Table[] queryHints)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
Collection parameters,
Table[] queryHints,
int start,
int end)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
int start,
int end)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
Table[] queryHints)
Queries for a list of dyna beans representing rows of the given query.
|
List |
fetch(Database model,
String sql,
Table[] queryHints,
int start,
int end)
Queries for a list of dyna beans representing rows of the given query.
|
String |
getAlterModelSql(Database currentModel,
Database desiredModel)
Returns the SQL for altering the given current model so that it match the desired model.
|
String |
getAlterModelSql(Database currentModel,
Database desiredModel,
CreationParameters params)
Returns the SQL for altering the given current model so that it match the desired model.
|
String |
getAlterTablesSql(Connection connection,
Database desiredDb)
Deprecated.
Use
getAlterModelSql(Database, Database) together with
readModelFromDatabase(Connection, String) instead. |
String |
getAlterTablesSql(Connection connection,
Database desiredDb,
CreationParameters params)
Deprecated.
Use
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(Connection, String) instead. |
String |
getAlterTablesSql(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb)
Deprecated.
Use
getAlterModelSql(Database, Database) together with
readModelFromDatabase(Connection, String, String, String, String[]) instead. |
String |
getAlterTablesSql(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params)
Deprecated.
|
String |
getAlterTablesSql(Database desiredDb)
Deprecated.
Use
getAlterModelSql(Database, Database) together with
readModelFromDatabase(String) instead. |
String |
getAlterTablesSql(Database desiredDb,
CreationParameters params)
Deprecated.
Use
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(String) instead. |
String |
getAlterTablesSql(String catalog,
String schema,
String[] tableTypes,
Database desiredDb)
Deprecated.
Use
getAlterModelSql(Database, Database) together with
readModelFromDatabase(String, String, String, String[]) instead. |
String |
getAlterTablesSql(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params)
Deprecated.
Use
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(String, String, String, String[]) instead. |
List |
getChanges(Database currentModel,
Database desiredModel)
Returns the necessary changes to apply to the current database to make it the desired one.
|
String |
getCreateModelSql(Database model,
boolean dropTablesFirst,
boolean continueOnError)
Returns the SQL for creating the tables defined in the database model.
|
String |
getCreateModelSql(Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Returns the SQL for creating the tables defined in the database model.
|
String |
getCreateTablesSql(Database model,
boolean dropTablesFirst,
boolean continueOnError)
Deprecated.
Use
getCreateModelSql(Database, boolean, boolean) instead. |
String |
getCreateTablesSql(Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Deprecated.
|
DataSource |
getDataSource()
Returns the data source that this platform uses to access the database.
|
String |
getDeleteSql(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Returns the sql for deleting the given bean from the database.
|
String |
getDropModelSql(Database model)
Returns the SQL for dropping the given model.
|
String |
getDropTableSql(Database model,
Table table,
boolean continueOnError)
Returns the SQL for dropping the given table and all foreign keys pointing to it.
|
String |
getDropTablesSql(Database model,
boolean continueOnError)
Deprecated.
Use
getDropModelSql(Database) instead. |
String |
getInsertSql(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Returns the sql for inserting the given bean.
|
int |
getIsolationLevel()
Get the current isolation level set for this platform.
|
JdbcModelReader |
getModelReader()
Returns the model reader (which reads a database model from a live database) for this platform.
|
String |
getName()
Returns the name of the database that this platform is for.
|
String |
getPassword()
Returns the password that this platform shall use to access the database.
|
PlatformInfo |
getPlatformInfo()
Returns the info object for this platform.
|
SqlBuilder |
getSqlBuilder()
Returns the sql builder for the this platform.
|
String |
getUpdateSql(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Returns the sql for updating the given bean in the database.
|
String |
getUpdateSql(Database model,
org.apache.commons.beanutils.DynaBean oldDynaBean,
org.apache.commons.beanutils.DynaBean newDynaBean)
Returns the sql for updating the given bean in the database.
|
String |
getUsername()
Returns the username that this platform shall use to access the database.
|
void |
insert(Connection connection,
Database model,
Collection dynaBeans)
Inserts the given beans.
|
void |
insert(Connection connection,
Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Inserts the bean.
|
void |
insert(Database model,
Collection dynaBeans)
Inserts the given beans in the database, assuming the primary key values are specified.
|
void |
insert(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Inserts the given DynaBean in the database, assuming the primary key values are specified.
|
boolean |
isAddIdentityUsingAlterTableOn()
Returns true if identity column has to be added at the end of a load
using ALTER TABLE (only supported by GemFireXD for now)
|
boolean |
isDefaultOnDeleteActionUsedIfUnsupported()
Determines whether the default action for ON DELETE is used if the specified one is not supported by the platform.
|
boolean |
isDefaultOnUpdateActionUsedIfUnsupported()
Determines whether the default action for ON UPDATE is used if the specified one is not supported by the platform.
|
boolean |
isDelimitedIdentifierModeOn()
Determines whether delimited identifiers are used or normal SQL92 identifiers
(which may only contain alphanumerical characters and the underscore, must start
with a letter and cannot be a reserved keyword).
|
boolean |
isForeignKeysSorted()
Determines whether foreign keys of a table read from a live database
are alphabetically sorted.
|
boolean |
isIdentityOverrideOn()
Determines whether SQL insert statements can specify values for identity columns.
|
boolean |
isScriptModeOn()
Determines whether script mode is on.
|
boolean |
isSqlCommentsOn()
Determines whether SQL comments are generated.
|
Iterator |
query(Database model,
String sql)
Performs the given SQL query returning an iterator over the results.
|
Iterator |
query(Database model,
String sql,
Collection parameters)
Performs the given parameterized SQL query returning an iterator over the results.
|
Iterator |
query(Database model,
String sql,
Collection parameters,
Table[] queryHints)
Performs the given parameterized SQL query returning an iterator over the results.
|
Iterator |
query(Database model,
String sql,
Table[] queryHints)
Performs the given SQL query returning an iterator over the results.
|
Database |
readModelFromDatabase(Connection connection,
String name)
Reads the database model from the live database to which the given connection is pointing.
|
Database |
readModelFromDatabase(Connection connection,
String name,
String catalog,
String schema,
String[] tableTypes)
Reads the database model from the live database to which the given connection is pointing.
|
Database |
readModelFromDatabase(String name)
Reads the database model from the live database as specified by the data source set for
this platform.
|
Database |
readModelFromDatabase(String name,
String catalog,
String schema,
String[] tableTypes)
Reads the database model from the live database as specified by the data source set for
this platform.
|
void |
returnConnection(Connection connection)
Closes the given JDBC connection (returns it back to the pool if the datasource is poolable).
|
void |
setAddIdentityUsingAlterTable(boolean v)
Set the flag for
isAddIdentityUsingAlterTableOn(). |
void |
setDataSource(DataSource dataSource)
Sets the data source that this platform shall use to access the database.
|
void |
setDefaultOnDeleteActionUsedIfUnsupported(boolean useDefault)
Specifies whether the default action for ON DELETE shall be used if the specified one is not supported by the platform.
|
void |
setDefaultOnUpdateActionUsedIfUnsupported(boolean useDefault)
Specifies whether the default action for ON UPDATE shall be used if the specified one is not supported by the platform.
|
void |
setDelimitedIdentifierModeOn(boolean delimitedIdentifierModeOn)
Specifies whether delimited identifiers are used or normal SQL92 identifiers.
|
void |
setForeignKeysSorted(boolean foreignKeysSorted)
Specifies whether foreign keys read from a live database, shall be
alphabetically sorted.
|
void |
setIdentityOverrideOn(boolean identityOverrideOn)
Specifies whether SQL insert statements can specify values for identity columns.
|
void |
setIsolationLevel(int level)
Set the transaction isolation level to use for all DB operations.
|
void |
setPassword(String password)
Sets the password that this platform shall use to access the database.
|
void |
setScriptModeOn(boolean scriptModeOn)
Specifies whether script mode is on.
|
void |
setSqlCommentsOn(boolean sqlCommentsOn)
Specifies whether SQL comments shall be generated.
|
void |
setUsername(String username)
Sets the username that this platform shall use to access the database.
|
void |
shutdownDatabase()
Performs a shutdown at the database.
|
void |
shutdownDatabase(Connection connection)
Performs a shutdown at the database.
|
void |
store(Connection connection,
Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Stores the given bean in the database, inserting it if there is no primary key
otherwise the bean is updated in the database.
|
void |
store(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Stores the given bean in the database, inserting it if there is no primary key
otherwise the bean is updated in the database.
|
void |
update(Connection connection,
Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Updates the row which maps to the given bean.
|
void |
update(Connection connection,
Database model,
org.apache.commons.beanutils.DynaBean oldDynaBean,
org.apache.commons.beanutils.DynaBean newDynaBean)
Updates the row identified by the given
oldDynaBean in the database with the
values in newDynaBean. |
void |
update(Database model,
org.apache.commons.beanutils.DynaBean dynaBean)
Updates the given bean in the database, assuming the primary key values are specified.
|
void |
update(Database model,
org.apache.commons.beanutils.DynaBean oldDynaBean,
org.apache.commons.beanutils.DynaBean newDynaBean)
Updates the row identified by the given
oldDynaBean in the database with the
values in newDynaBean. |
String |
writeAllDDLs(boolean exportAll)
Export all DDLs executed in the system as SQL strings.
|
String getName()
PlatformInfo getPlatformInfo()
SqlBuilder getSqlBuilder()
JdbcModelReader getModelReader()
DataSource getDataSource()
void setDataSource(DataSource dataSource)
dataSource - The data sourceString getUsername()
void setUsername(String username)
username - The usernameString getPassword()
void setPassword(String password)
password - The passwordboolean isScriptModeOn()
true if script mode is onvoid setScriptModeOn(boolean scriptModeOn)
scriptModeOn - true if script mode is onboolean isDelimitedIdentifierModeOn()
true if delimited identifiers are usedvoid setDelimitedIdentifierModeOn(boolean delimitedIdentifierModeOn)
delimitedIdentifierModeOn - true if delimited identifiers shall be usedboolean isSqlCommentsOn()
true if SQL comments shall be generatedvoid setSqlCommentsOn(boolean sqlCommentsOn)
sqlCommentsOn - true if SQL comments shall be generatedboolean isIdentityOverrideOn()
PlatformInfo.isIdentityOverrideAllowed()). If this is off, then the
insert methods will ignore values for identity columns.true if identity override is enabled (the default)void setIdentityOverrideOn(boolean identityOverrideOn)
PlatformInfo.isIdentityOverrideAllowed()). If this is off, then the
insert methods will ignore values for identity columns.identityOverrideOn - true if identity override is enabled (the default)boolean isForeignKeysSorted()
true if read foreign keys are sortedvoid setForeignKeysSorted(boolean foreignKeysSorted)
foreignKeysSorted - true if read foreign keys shall be sortedboolean isDefaultOnUpdateActionUsedIfUnsupported()
false, then an exception will be thrown if the action is not supported. By default, this
is set to true meaning that the default action would be used.true if the default action is usedvoid setDefaultOnUpdateActionUsedIfUnsupported(boolean useDefault)
false, then an exception will be thrown if the action is not supported. By default, this
is set to true meaning that the default action would be used.useDefault - If true then the default action will be usedboolean isDefaultOnDeleteActionUsedIfUnsupported()
false, then an exception will be thrown if the action is not supported. By default, this
is set to true meaning that the default action would be used.true if the default action is usedvoid setDefaultOnDeleteActionUsedIfUnsupported(boolean useDefault)
false, then an exception will be thrown if the action is not supported. By default, this
is set to true meaning that the default action would be used.useDefault - If true then the default action will be usedConnection borrowConnection() throws DatabaseOperationException
DatabaseOperationExceptionvoid returnConnection(Connection connection)
connection - The connectionint evaluateBatch(String sql, boolean continueOnError) throws DatabaseOperationException
PlatformInfo.getSqlCommandDelimiter() of the info object
of this platform.sql - The sql statements to executecontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionint evaluateBatch(Connection connection, String sql, boolean continueOnError) throws DatabaseOperationException
PlatformInfo.getSqlCommandDelimiter() of the info object
of this platform.
TODO: consider outputting a collection of String or some kind of statement
object from the SqlBuilder instead of having to parse strings hereconnection - The connection to the databasesql - The sql statements to executecontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid shutdownDatabase()
throws DatabaseOperationException
DatabaseOperationExceptionvoid shutdownDatabase(Connection connection) throws DatabaseOperationException
connection - The connection to the databaseDatabaseOperationExceptionvoid createDatabase(String jdbcDriverClassName, String connectionUrl, String username, String password, Map parameters) throws DatabaseOperationException, UnsupportedOperationException
setDataSource(DataSource) because it is not possible to
retrieve the connection information from it without establishing a connection.jdbcDriverClassName - The jdbc driver class nameconnectionUrl - The url to connect to the database if it were already createdusername - The username for creating the databasepassword - The password for creating the databaseparameters - Additional parameters relevant to database creation (which are platform specific)DatabaseOperationExceptionUnsupportedOperationExceptionvoid dropDatabase(String jdbcDriverClassName, String connectionUrl, String username, String password) throws DatabaseOperationException, UnsupportedOperationException
setDataSource(DataSource) because it is not possible to
retrieve the connection information from it without establishing a connection.jdbcDriverClassName - The jdbc driver class nameconnectionUrl - The url to connect to the databaseusername - The username for creating the databasepassword - The password for creating the databaseDatabaseOperationExceptionUnsupportedOperationExceptionvoid createTables(Database model, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
createModel(Database, boolean, boolean) instead.model - The database modeldropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid createTables(Connection connection, Database model, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
createModel(Connection, Database, boolean, boolean) instead.connection - The connection to the databasemodel - The database modeldropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid createTables(Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
createModel(Database, CreationParameters, boolean, boolean) instead.model - The database modelparams - The parameters used in the creationdropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid createTables(Connection connection, Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
createModel(Connection, Database, CreationParameters, boolean, boolean) instead.connection - The connection to the databasemodel - The database modelparams - The parameters used in the creationdropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionString getCreateTablesSql(Database model, boolean dropTablesFirst, boolean continueOnError)
getCreateModelSql(Database, boolean, boolean) instead.model - The database modeldropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredString getCreateTablesSql(Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError)
getCreateModelSql(Database, CreationParameters, boolean, boolean) instead.model - The database modelparams - The parameters used in the creationdropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredvoid createModel(Database model, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
model - The database modeldropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid createModel(Connection connection, Database model, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
connection - The connection to the databasemodel - The database modeldropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid createModel(Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
model - The database modelparams - The parameters used in the creationdropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid createModel(Connection connection, Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DatabaseOperationException
connection - The connection to the databasemodel - The database modelparams - The parameters used in the creationdropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionString getCreateModelSql(Database model, boolean dropTablesFirst, boolean continueOnError)
model - The database modeldropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredString getCreateModelSql(Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError)
model - The database modelparams - The parameters used in the creationdropTablesFirst - Whether to drop the tables prior to creating them (anew)continueOnError - Whether to continue executing the sql commands when an error occurredList getChanges(Database currentModel, Database desiredModel)
currentModel - The current modeldesiredModel - The desired modelvoid alterTables(Database desiredDb, boolean continueOnError) throws DatabaseOperationException
alterModel(Database, Database, boolean) together with
readModelFromDatabase(String) instead.desiredDb - The desired database schemacontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
alterModel(Database, Database, CreationParameters, boolean) together with
readModelFromDatabase(String) instead.desiredDb - The desired database schemaparams - The parameters used in the creationcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(String catalog, String schema, String[] tableTypes, Database desiredDb, boolean continueOnError) throws DatabaseOperationException
alterModel(Database, Database, boolean) together with
readModelFromDatabase(String, String, String, String[]) instead.catalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemacontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
alterModel(Database, Database, CreationParameters, boolean) together with
readModelFromDatabase(String, String, String, String[]) instead.catalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemaparams - The parameters used in the creationcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(Connection connection, Database desiredDb, boolean continueOnError) throws DatabaseOperationException
alterModel(Connection, Database, Database, boolean) together with
readModelFromDatabase(Connection, String) instead.connection - A connection to the existing database that shall be modifieddesiredDb - The desired database schemacontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(Connection connection, Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
alterModel(Connection, Database, Database, CreationParameters, boolean) together with
readModelFromDatabase(Connection, String) instead.connection - A connection to the existing database that shall be modifieddesiredDb - The desired database schemaparams - The parameters used in the creationcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, boolean continueOnError) throws DatabaseOperationException
alterModel(Connection, Database, Database, boolean) together with
readModelFromDatabase(Connection, String, String, String, String[]) instead.connection - A connection to the existing database that shall be modifiedcatalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemacontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterTables(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
alterModel(Connection, Database, Database, CreationParameters, boolean) together with
readModelFromDatabase(Connection, String, String, String, String[]) instead.connection - A connection to the existing database that shall be modifiedcatalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemaparams - The parameters used in the creationcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionString getAlterTablesSql(Database desiredDb) throws DatabaseOperationException
getAlterModelSql(Database, Database) together with
readModelFromDatabase(String) instead.desiredDb - The desired database schemaDatabaseOperationExceptionString getAlterTablesSql(Database desiredDb, CreationParameters params) throws DatabaseOperationException
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(String) instead.desiredDb - The desired database schemaparams - The parameters used in the creationDatabaseOperationExceptionString getAlterTablesSql(String catalog, String schema, String[] tableTypes, Database desiredDb) throws DatabaseOperationException
getAlterModelSql(Database, Database) together with
readModelFromDatabase(String, String, String, String[]) instead.catalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemaDatabaseOperationExceptionString getAlterTablesSql(String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params) throws DatabaseOperationException
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(String, String, String, String[]) instead.catalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemaparams - The parameters used in the creationDatabaseOperationExceptionString getAlterTablesSql(Connection connection, Database desiredDb) throws DatabaseOperationException
getAlterModelSql(Database, Database) together with
readModelFromDatabase(Connection, String) instead.connection - A connection to the existing database that shall be modifieddesiredDb - The desired database schemaDatabaseOperationExceptionString getAlterTablesSql(Connection connection, Database desiredDb, CreationParameters params) throws DatabaseOperationException
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(Connection, String) instead.connection - A connection to the existing database that shall be modifieddesiredDb - The desired database schemaparams - The parameters used in the creationDatabaseOperationExceptionString getAlterTablesSql(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb) throws DatabaseOperationException
getAlterModelSql(Database, Database) together with
readModelFromDatabase(Connection, String, String, String, String[]) instead.connection - A connection to the existing database that shall be modifiedcatalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemaDatabaseOperationExceptionString getAlterTablesSql(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params) throws DatabaseOperationException
getAlterModelSql(Database, Database, CreationParameters) together with
readModelFromDatabase(Connection, String, String, String, String[]) instead.connection - A connection to the existing database that shall be modifiedcatalog - The catalog in the existing database to read (can be a pattern);
use null for the platform-specific default valueschema - The schema in the existing database to read (can be a pattern);
use null for the platform-specific default valuetableTypes - The table types to read from the existing database;
use null or an empty array for the platform-specific default valuedesiredDb - The desired database schemaparams - The parameters used in the creationDatabaseOperationExceptionvoid alterModel(Database currentModel, Database desiredModel, boolean continueOnError) throws DatabaseOperationException
currentModel - The current database modeldesiredModel - The desired database modelcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterModel(Database currentModel, Database desiredModel, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
currentModel - The current database modeldesiredModel - The desired database modelparams - The parameters used in the creationcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterModel(Connection connection, Database currentModel, Database desiredModel, boolean continueOnError) throws DatabaseOperationException
connection - A connection to the existing database that shall be modifiedcurrentModel - The current database modeldesiredModel - The desired database modelcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionvoid alterModel(Connection connection, Database currentModel, Database desiredModel, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
connection - A connection to the existing database that shall be modifiedcurrentModel - The current database modeldesiredModel - The desired database modelparams - The parameters used in the creationcontinueOnError - Whether to continue with the next sql statement when an error occurredDatabaseOperationExceptionString getAlterModelSql(Database currentModel, Database desiredModel) throws DatabaseOperationException
currentModel - The current database modeldesiredModel - The desired database modelDatabaseOperationExceptionString getAlterModelSql(Database currentModel, Database desiredModel, CreationParameters params) throws DatabaseOperationException
currentModel - The current database modeldesiredModel - The desired database modelparams - The parameters used in the creation of tables etc.DatabaseOperationExceptionvoid dropTable(Database model, Table table, boolean continueOnError) throws DatabaseOperationException
model - The database modeltable - The table to dropcontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionString getDropTableSql(Database model, Table table, boolean continueOnError)
model - The database modeltable - The table to dropcontinueOnError - Whether to continue executing the sql commands when an error occurredvoid dropTable(Connection connection, Database model, Table table, boolean continueOnError) throws DatabaseOperationException
connection - The connection to the databasemodel - The database modeltable - The table to dropcontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionString getDropTablesSql(Database model, boolean continueOnError)
getDropModelSql(Database) instead.model - The database modelcontinueOnError - Whether to continue executing the sql commands when an error occurredvoid dropTables(Database model, boolean continueOnError) throws DatabaseOperationException
dropModel(Database, boolean) instead.model - The database modelcontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid dropTables(Connection connection, Database model, boolean continueOnError) throws DatabaseOperationException
dropModel(Connection, Database, boolean) instead.connection - The connection to the databasemodel - The database modelcontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionString getDropModelSql(Database model)
model - The database modelvoid dropModel(Database model, boolean continueOnError) throws DatabaseOperationException
model - The database modelcontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionvoid dropModel(Connection connection, Database model, boolean continueOnError) throws DatabaseOperationException
connection - The connection to the databasemodel - The database modelcontinueOnError - Whether to continue executing the sql commands when an error occurredDatabaseOperationExceptionIterator query(Database model, String sql) throws DatabaseOperationException
model - The database model to usesql - The sql query to performDatabaseOperationExceptionIterator query(Database model, String sql, Collection parameters) throws DatabaseOperationException
model - The database model to usesql - The sql query to performparameters - The query parameter valuesDatabaseOperationExceptionIterator query(Database model, String sql, Table[] queryHints) throws DatabaseOperationException
model - The database model to usesql - The sql query to performqueryHints - The tables that are queried (optional)DatabaseOperationExceptionIterator query(Database model, String sql, Collection parameters, Table[] queryHints) throws DatabaseOperationException
model - The database model to usesql - The sql query to performparameters - The query parameter valuesqueryHints - The tables that are queried (optional)DatabaseOperationExceptionList fetch(Database model, String sql) throws DatabaseOperationException
query(Database, String) method all beans will be
materialized and the connection will be closed before returning the beans.model - The database model to usesql - The sql queryDatabaseOperationExceptionList fetch(Database model, String sql, Collection parameters) throws DatabaseOperationException
query(Database, String, Collection) method
all beans will be materialized and the connection will be closed before
returning the beans.model - The database model to usesql - The parameterized queryparameters - The parameter valuesDatabaseOperationExceptionList fetch(Database model, String sql, Table[] queryHints) throws DatabaseOperationException
query(Database, String) method all beans will be
materialized and the connection will be closed before returning the beans.model - The database model to usesql - The sql queryqueryHints - The tables that are queried (optional)DatabaseOperationExceptionList fetch(Database model, String sql, Collection parameters, Table[] queryHints) throws DatabaseOperationException
query(Database, String, Collection) method
all beans will be materialized and the connection will be closed before
returning the beans.model - The database model to usesql - The parameterized queryparameters - The parameter valuesqueryHints - The tables that are queried (optional)DatabaseOperationExceptionList fetch(Database model, String sql, int start, int end) throws DatabaseOperationException
query(Database, String) method all beans will be
materialized and the connection will be closed before returning the beans.
Also, the two int parameters specify which rows of the result set to use.
If there are more rows than desired, they will be ignored (and not read
from the database).model - The database model to usesql - The sql querystart - Row number to start from (0 for first row)end - Row number to stop at (inclusively; -1 for last row)DatabaseOperationExceptionList fetch(Database model, String sql, Collection parameters, int start, int end) throws DatabaseOperationException
query(Database, String, Collection) method all
beans will be materialized and the connection will be closed before returning
the beans. Also, the two int parameters specify which rows of the result set
to use. If there are more rows than desired, they will be ignored (and not
read from the database).model - The database model to usesql - The parameterized sql queryparameters - The parameter valuesstart - Row number to start from (0 for first row)end - Row number to stop at (inclusively; -1 for last row)DatabaseOperationExceptionList fetch(Database model, String sql, Table[] queryHints, int start, int end) throws DatabaseOperationException
query(Database, String, Table[]) method all
beans will be materialized and the connection will be closed before
returning the beans. Also, the two int parameters specify which rows of
the result set to use. If there are more rows than desired, they will be
ignored (and not read from the database).model - The database model to usesql - The sql queryqueryHints - The tables that are queried (optional)start - Row number to start from (0 for first row)end - Row number to stop at (inclusively; -1 for last row)DatabaseOperationExceptionList fetch(Database model, String sql, Collection parameters, Table[] queryHints, int start, int end) throws DatabaseOperationException
query(Database, String, Collection, Table[])
method all beans will be materialized and the connection will be closed
before returning the beans. Also, the two int parameters specify which
rows of the result set to use. If there are more rows than desired, they
will be ignored (and not read from the database).model - The database model to usesql - The parameterized sql queryparameters - The parameter valuesqueryHints - The tables that are queried (optional)start - Row number to start from (0 for first row)end - Row number to stop at (inclusively; -1 for last row)DatabaseOperationExceptionboolean exists(Database model, org.apache.commons.beanutils.DynaBean dynaBean)
model - The database model to usedynaBean - The beantrue if a bean with this primary key exists in the databaseboolean exists(Connection connection, Database model, org.apache.commons.beanutils.DynaBean dynaBean)
connection - The connectionmodel - The database model to usedynaBean - The beantrue if a bean with this primary key exists in the databasevoid store(Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
model - The database model to usedynaBean - The bean to storeDatabaseOperationExceptionvoid store(Connection connection, Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
connection - The connectionmodel - The database model to usedynaBean - The bean to storeDatabaseOperationExceptionString getInsertSql(Database model, org.apache.commons.beanutils.DynaBean dynaBean)
model - The database model to usedynaBean - The beanvoid insert(Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
model - The database model to usedynaBean - The bean to insertDatabaseOperationExceptionvoid insert(Connection connection, Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
connection - The database connectionmodel - The database model to usedynaBean - The beanDatabaseOperationExceptionvoid insert(Database model, Collection dynaBeans) throws DatabaseOperationException
model - The database model to usedynaBeans - The beans to insertDatabaseOperationExceptionvoid insert(Connection connection, Database model, Collection dynaBeans) throws DatabaseOperationException
connection - The database connectionmodel - The database model to usedynaBeans - The beansDatabaseOperationExceptionString getUpdateSql(Database model, org.apache.commons.beanutils.DynaBean dynaBean)
model - The database model to usedynaBean - The beanString getUpdateSql(Database model, org.apache.commons.beanutils.DynaBean oldDynaBean, org.apache.commons.beanutils.DynaBean newDynaBean)
model - The database model to useoldDynaBean - The bean identifying the row to updatenewDynaBean - The bean containing the new valuesvoid update(Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
model - The database model to usedynaBean - The beanDatabaseOperationExceptionvoid update(Connection connection, Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
connection - The database connectionmodel - The database model to usedynaBean - The beanDatabaseOperationExceptionvoid update(Database model, org.apache.commons.beanutils.DynaBean oldDynaBean, org.apache.commons.beanutils.DynaBean newDynaBean) throws DatabaseOperationException
oldDynaBean in the database with the
values in newDynaBean. This method can be used to update primary key columns.model - The database model to useoldDynaBean - The bean identifying the row (which means the primary key fields need to be specified)newDynaBean - The bean containing the new dataDatabaseOperationExceptionvoid update(Connection connection, Database model, org.apache.commons.beanutils.DynaBean oldDynaBean, org.apache.commons.beanutils.DynaBean newDynaBean) throws DatabaseOperationException
oldDynaBean in the database with the
values in newDynaBean. This method can be used to update primary key columns.connection - The database connectionmodel - The database model to useoldDynaBean - The bean identifying the row (which means the primary key fields need to be specified)newDynaBean - The bean containing the new dataDatabaseOperationExceptionString getDeleteSql(Database model, org.apache.commons.beanutils.DynaBean dynaBean)
model - The database model to usedynaBean - The beanvoid delete(Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
model - The database model to usedynaBean - The bean to deleteDatabaseOperationExceptionvoid delete(Connection connection, Database model, org.apache.commons.beanutils.DynaBean dynaBean) throws DatabaseOperationException
model - The database model to usedynaBean - The beanconnection - The database connectionDatabaseOperationExceptionDatabase readModelFromDatabase(String name) throws DatabaseOperationException
name - The name of the resulting database; null when the default name (the catalog)
is desired which might be null itself thoughDatabaseOperationException - If an error occurred during reading the modelDatabase readModelFromDatabase(String name, String catalog, String schema, String[] tableTypes) throws DatabaseOperationException
name - The name of the resulting database; null when the default name (the catalog)
is desired which might be null itself thoughcatalog - The catalog to access in the database; use null for the default valueschema - The schema to access in the database; use null for the default valuetableTypes - The table types to process; use null or an empty list for the default onesDatabaseOperationException - If an error occurred during reading the modelDatabase readModelFromDatabase(Connection connection, String name) throws DatabaseOperationException
connection - The connection to the databasename - The name of the resulting database; null when the default name (the catalog)
is desired which might be null itself thoughDatabaseOperationException - If an error occurred during reading the modelDatabase readModelFromDatabase(Connection connection, String name, String catalog, String schema, String[] tableTypes) throws DatabaseOperationException
connection - The connection to the databasename - The name of the resulting database; null when the default name (the catalog)
is desired which might be null itself thoughcatalog - The catalog to access in the database; use null for the default valueschema - The schema to access in the database; use null for the default valuetableTypes - The table types to process; use null or an empty list for the default onesDatabaseOperationException - If an error occurred during reading the modelboolean isAddIdentityUsingAlterTableOn()
void setAddIdentityUsingAlterTable(boolean v)
isAddIdentityUsingAlterTableOn().int getIsolationLevel()
void setIsolationLevel(int level)
String writeAllDDLs(boolean exportAll) throws DatabaseOperationException
exportAll - if true then also export all database objects including
jars/listeners etcDatabaseOperationExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.