|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A platform encapsulates the database-related functionality such as performing queries and manipulations. It also contains an sql builder that is specific to this platform.
Method Summary | |
void |
alterTables(Connection connection,
Database desiredDb,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Connection connection,
Database desiredDb,
CreationParameters params,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Database desiredDb,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Database desiredDb,
CreationParameters params,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params,
boolean continueOnError)
Alters the database schema so that it match the given model. |
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 |
createTables(Connection connection,
Database model,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model. |
void |
createTables(Connection connection,
Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model. |
void |
createTables(Database model,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model. |
void |
createTables(Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Creates the tables defined in the database model. |
void |
delete(Connection connection,
Database model,
DynaBean dynaBean)
Deletes the row which maps to the given bean from the database. |
void |
delete(Database model,
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 |
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)
Drops the tables defined in the given database. |
void |
dropTables(Database model,
boolean continueOnError)
Drops the tables defined in the given database. |
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. |
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 |
getAlterTablesSql(Connection connection,
Database desiredDb)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Connection connection,
Database desiredDb,
CreationParameters params)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Connection connection,
String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Database desiredDb)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Database desiredDb,
CreationParameters params)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(String catalog,
String schema,
String[] tableTypes,
Database desiredDb)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
CreationParameters params)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getCreateTablesSql(Database model,
boolean dropTablesFirst,
boolean continueOnError)
Returns the SQL for creating the tables defined in the database model. |
String |
getCreateTablesSql(Database model,
CreationParameters params,
boolean dropTablesFirst,
boolean continueOnError)
Returns the SQL for creating the tables defined in the database model. |
DataSource |
getDataSource()
Returns the data source that this platform uses to access the database. |
String |
getDeleteSql(Database model,
DynaBean dynaBean)
Returns the sql for deleting the given bean from the database. |
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)
Returns the SQL for dropping the tables defined in the given database. |
String |
getInsertSql(Database model,
DynaBean dynaBean)
Returns the sql for inserting the given bean. |
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,
DynaBean dynaBean)
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,
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,
DynaBean dynaBean)
Inserts the given DynaBean in the database, assuming the primary key values are specified. |
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 |
setDataSource(DataSource dataSource)
Sets the data source that this platform shall use to access the database. |
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 |
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(Database model,
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,
DynaBean dynaBean)
Updates the row which maps to the given bean. |
void |
update(Database model,
DynaBean dynaBean)
Updates the given bean in the database, assuming the primary key values are specified. |
Method Detail |
public String getName()
public PlatformInfo getPlatformInfo()
public SqlBuilder getSqlBuilder()
public JdbcModelReader getModelReader()
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
dataSource
- The data sourcepublic String getUsername()
public void setUsername(String username)
username
- The usernamepublic String getPassword()
public void setPassword(String password)
password
- The passwordpublic boolean isScriptModeOn()
true
if script mode is onpublic void setScriptModeOn(boolean scriptModeOn)
scriptModeOn
- true
if script mode is onpublic boolean isDelimitedIdentifierModeOn()
true
if delimited identifiers are usedpublic void setDelimitedIdentifierModeOn(boolean delimitedIdentifierModeOn)
delimitedIdentifierModeOn
- true
if delimited identifiers shall be usedpublic boolean isSqlCommentsOn()
true
if SQL comments shall be generatedpublic void setSqlCommentsOn(boolean sqlCommentsOn)
sqlCommentsOn
- true
if SQL comments shall be generatedpublic boolean 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)public 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)public boolean isForeignKeysSorted()
true
if read foreign keys are sortedpublic void setForeignKeysSorted(boolean foreignKeysSorted)
foreignKeysSorted
- true
if read foreign keys shall be sortedpublic Connection borrowConnection() throws DatabaseOperationException
DatabaseOperationException
public void returnConnection(Connection connection)
connection
- The connectionpublic int 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 occurred
DatabaseOperationException
public int 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 here
connection
- The connection to the databasesql
- The sql statements to executecontinueOnError
- Whether to continue executing the sql commands when an error occurred
DatabaseOperationException
public void shutdownDatabase() throws DatabaseOperationException
DatabaseOperationException
public void shutdownDatabase(Connection connection) throws DatabaseOperationException
connection
- The connection to the database
DatabaseOperationException
public void 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)
DatabaseOperationException
UnsupportedOperationException
public void 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 database
DatabaseOperationException
UnsupportedOperationException
public void createTables(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 occurred
DatabaseOperationException
public void createTables(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 occurred
DatabaseOperationException
public String getCreateTablesSql(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 occurred
public void createTables(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 occurred
DatabaseOperationException
public void createTables(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 occurred
DatabaseOperationException
public String getCreateTablesSql(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 occurred
public void alterTables(Database desiredDb, boolean continueOnError) throws DatabaseOperationException
desiredDb
- The desired database schemacontinueOnError
- Whether to continue with the next sql statement when an error occurred
DatabaseOperationException
public String getAlterTablesSql(Database desiredDb) throws DatabaseOperationException
desiredDb
- The desired database schema
DatabaseOperationException
public void alterTables(Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
desiredDb
- The desired database schemaparams
- The parameters used in the creationcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DatabaseOperationException
public String getAlterTablesSql(Database desiredDb, CreationParameters params) throws DatabaseOperationException
desiredDb
- The desired database schemaparams
- The parameters used in the creation
DatabaseOperationException
public void alterTables(String catalog, String schema, String[] tableTypes, Database desiredDb, boolean continueOnError) throws DatabaseOperationException
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 occurred
DatabaseOperationException
public String getAlterTablesSql(String catalog, String schema, String[] tableTypes, Database desiredDb) throws DatabaseOperationException
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 schema
DatabaseOperationException
public void alterTables(String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
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 occurred
DatabaseOperationException
public String getAlterTablesSql(String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params) throws DatabaseOperationException
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 creation
DatabaseOperationException
public void alterTables(Connection connection, Database desiredDb, boolean continueOnError) throws DatabaseOperationException
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 occurred
DatabaseOperationException
public String getAlterTablesSql(Connection connection, Database desiredDb) throws DatabaseOperationException
connection
- A connection to the existing database that shall be modifieddesiredDb
- The desired database schema
DatabaseOperationException
public void alterTables(Connection connection, Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
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 occurred
DatabaseOperationException
public String getAlterTablesSql(Connection connection, Database desiredDb, CreationParameters params) throws DatabaseOperationException
connection
- A connection to the existing database that shall be modifieddesiredDb
- The desired database schemaparams
- The parameters used in the creation
DatabaseOperationException
public void alterTables(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, boolean continueOnError) throws DatabaseOperationException
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 occurred
DatabaseOperationException
public String getAlterTablesSql(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb) throws DatabaseOperationException
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 schema
DatabaseOperationException
public void alterTables(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean continueOnError) throws DatabaseOperationException
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 occurred
DatabaseOperationException
public String getAlterTablesSql(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params) throws DatabaseOperationException
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 creation
DatabaseOperationException
public void 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 occurred
DatabaseOperationException
public String 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 occurred
public void 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 occurred
DatabaseOperationException
public void dropTables(Database model, boolean continueOnError) throws DatabaseOperationException
model
- The database modelcontinueOnError
- Whether to continue executing the sql commands when an error occurred
DatabaseOperationException
public String getDropTablesSql(Database model, boolean continueOnError)
model
- The database modelcontinueOnError
- Whether to continue executing the sql commands when an error occurred
public void dropTables(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 occurred
DatabaseOperationException
public Iterator query(Database model, String sql) throws DatabaseOperationException
model
- The database model to usesql
- The sql query to perform
DatabaseOperationException
public Iterator query(Database model, String sql, Collection parameters) throws DatabaseOperationException
model
- The database model to usesql
- The sql query to performparameters
- The query parameter values
DatabaseOperationException
public Iterator 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)
DatabaseOperationException
public Iterator 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)
DatabaseOperationException
public List 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 query
DatabaseOperationException
public List 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 values
DatabaseOperationException
public List 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)
DatabaseOperationException
public List 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)
DatabaseOperationException
public List 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)
DatabaseOperationException
public List 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)
DatabaseOperationException
public List 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)
DatabaseOperationException
public List 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)
DatabaseOperationException
public void store(Database model, DynaBean dynaBean) throws DatabaseOperationException
model
- The database model to usedynaBean
- The bean to store
DatabaseOperationException
public String getInsertSql(Database model, DynaBean dynaBean)
model
- The database model to usedynaBean
- The bean
public void insert(Database model, DynaBean dynaBean) throws DatabaseOperationException
model
- The database model to usedynaBean
- The bean to insert
DatabaseOperationException
public void insert(Connection connection, Database model, DynaBean dynaBean) throws DatabaseOperationException
connection
- The database connectionmodel
- The database model to usedynaBean
- The bean
DatabaseOperationException
public void insert(Database model, Collection dynaBeans) throws DatabaseOperationException
model
- The database model to usedynaBeans
- The beans to insert
DatabaseOperationException
public void insert(Connection connection, Database model, Collection dynaBeans) throws DatabaseOperationException
connection
- The database connectionmodel
- The database model to usedynaBeans
- The beans
DatabaseOperationException
public String getUpdateSql(Database model, DynaBean dynaBean)
model
- The database model to usedynaBean
- The bean
public void update(Database model, DynaBean dynaBean) throws DatabaseOperationException
model
- The database model to usedynaBean
- The bean
DatabaseOperationException
public void update(Connection connection, Database model, DynaBean dynaBean) throws DatabaseOperationException
connection
- The database connectionmodel
- The database model to usedynaBean
- The bean
DatabaseOperationException
public String getDeleteSql(Database model, DynaBean dynaBean)
model
- The database model to usedynaBean
- The bean
public void delete(Database model, DynaBean dynaBean) throws DatabaseOperationException
model
- The database model to usedynaBean
- The bean to delete
DatabaseOperationException
public void delete(Connection connection, Database model, DynaBean dynaBean) throws DatabaseOperationException
model
- The database model to usedynaBean
- The beanconnection
- The database connection
DatabaseOperationException
public Database 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 though
DatabaseOperationException
- If an error occurred during reading the modelpublic Database 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 ones
DatabaseOperationException
- If an error occurred during reading the modelpublic Database 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 though
DatabaseOperationException
- If an error occurred during reading the modelpublic Database 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 ones
DatabaseOperationException
- If an error occurred during reading the model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |