|
||||||||||
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 doDrops,
boolean modifyColumns,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Connection connection,
Database desiredDb,
CreationParameters params,
boolean doDrops,
boolean modifyColumns,
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 doDrops,
boolean modifyColumns,
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 doDrops,
boolean modifyColumns,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Database desiredDb,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(Database desiredDb,
CreationParameters params,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
Alters the database schema so that it match the given model. |
void |
alterTables(String catalog,
String schema,
String[] tableTypes,
Database desiredDb,
boolean doDrops,
boolean modifyColumns,
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 doDrops,
boolean modifyColumns,
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 |
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,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Connection connection,
Database desiredDb,
CreationParameters params,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
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,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
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,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Database desiredDb,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
Returns the SQL for altering the database schema so that it match the given model. |
String |
getAlterTablesSql(Database desiredDb,
CreationParameters params,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
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,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
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,
boolean doDrops,
boolean modifyColumns,
boolean continueOnError)
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 |
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. |
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 |
setPassword(String password)
Sets the password that this platform shall use to access the database. |
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 Connection borrowConnection() throws DynaSqlException
DynaSqlException
public void returnConnection(Connection connection)
connection
- The connectionpublic int evaluateBatch(String sql, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public int evaluateBatch(Connection connection, String sql, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public void shutdownDatabase() throws DynaSqlException
DynaSqlException
public void shutdownDatabase(Connection connection) throws DynaSqlException
connection
- The connection to the database
DynaSqlException
public void createDatabase(String jdbcDriverClassName, String connectionUrl, String username, String password, Map parameters) throws DynaSqlException, 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)
DynaSqlException
UnsupportedOperationException
public void dropDatabase(String jdbcDriverClassName, String connectionUrl, String username, String password) throws DynaSqlException, 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
DynaSqlException
UnsupportedOperationException
public void createTables(Database model, boolean dropTablesFirst, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public void createTables(Connection connection, Database model, boolean dropTablesFirst, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public String getCreateTablesSql(Database model, boolean dropTablesFirst, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public void createTables(Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public void createTables(Connection connection, Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public String getCreateTablesSql(Database model, CreationParameters params, boolean dropTablesFirst, boolean continueOnError) throws DynaSqlException
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
DynaSqlException
public void alterTables(Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
desiredDb
- The desired database schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
desiredDb
- The desired database schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
desiredDb
- The desired database schemaparams
- The parameters used in the creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
desiredDb
- The desired database schemaparams
- The parameters used in the creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(String catalog, String schema, String[] tableTypes, Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(String catalog, String schema, String[] tableTypes, Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(Connection connection, Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
connection
- A connection to the existing database that shall be modifieddesiredDb
- The desired database schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(Connection connection, Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
connection
- A connection to the existing database that shall be modifieddesiredDb
- The desired database schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(Connection connection, Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
connection
- A connection to the existing database that shall be modifieddesiredDb
- The desired database schemaparams
- The parameters used in the creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(Connection connection, Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
connection
- A connection to the existing database that shall be modifieddesiredDb
- The desired database schemaparams
- The parameters used in the creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 schemadoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void alterTables(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public String getAlterTablesSql(Connection connection, String catalog, String schema, String[] tableTypes, Database desiredDb, CreationParameters params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
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 creationdoDrops
- Whether columns, tables and indexes should be dropped if not in the
new schemamodifyColumns
- Whether columns should be altered for datatype, size as requiredcontinueOnError
- Whether to continue with the next sql statement when an error occurred
DynaSqlException
public void dropTables(Database model, boolean continueOnError) throws DynaSqlException
model
- The database modelcontinueOnError
- Whether to continue executing the sql commands when an error occurred
DynaSqlException
public String getDropTablesSql(Database model, boolean continueOnError) throws DynaSqlException
model
- The database modelcontinueOnError
- Whether to continue executing the sql commands when an error occurred
DynaSqlException
public void dropTables(Connection connection, Database model, boolean continueOnError) throws DynaSqlException
connection
- The connection to the databasemodel
- The database modelcontinueOnError
- Whether to continue executing the sql commands when an error occurred
DynaSqlException
public Iterator query(Database model, String sql) throws DynaSqlException
model
- The database model to usesql
- The sql query to perform
DynaSqlException
public Iterator query(Database model, String sql, Collection parameters) throws DynaSqlException
model
- The database model to usesql
- The sql query to performparameters
- The query parameter values
DynaSqlException
public Iterator query(Database model, String sql, Table[] queryHints) throws DynaSqlException
model
- The database model to usesql
- The sql query to performqueryHints
- The tables that are queried (optional)
DynaSqlException
public Iterator query(Database model, String sql, Collection parameters, Table[] queryHints) throws DynaSqlException
model
- The database model to usesql
- The sql query to performparameters
- The query parameter valuesqueryHints
- The tables that are queried (optional)
DynaSqlException
public List fetch(Database model, String sql) throws DynaSqlException
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
DynaSqlException
public List fetch(Database model, String sql, Collection parameters) throws DynaSqlException
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
DynaSqlException
public List fetch(Database model, String sql, Table[] queryHints) throws DynaSqlException
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)
DynaSqlException
public List fetch(Database model, String sql, Collection parameters, Table[] queryHints) throws DynaSqlException
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)
DynaSqlException
public List fetch(Database model, String sql, int start, int end) throws DynaSqlException
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)
DynaSqlException
public List fetch(Database model, String sql, Collection parameters, int start, int end) throws DynaSqlException
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)
DynaSqlException
public List fetch(Database model, String sql, Table[] queryHints, int start, int end) throws DynaSqlException
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)
DynaSqlException
public List fetch(Database model, String sql, Collection parameters, Table[] queryHints, int start, int end) throws DynaSqlException
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)
DynaSqlException
public void store(Database model, DynaBean dynaBean) throws DynaSqlException
model
- The database model to usedynaBean
- The bean to store
DynaSqlException
public String getInsertSql(Database model, DynaBean dynaBean)
model
- The database model to usedynaBean
- The bean
public void insert(Database model, DynaBean dynaBean) throws DynaSqlException
model
- The database model to usedynaBean
- The bean to insert
DynaSqlException
public void insert(Connection connection, Database model, DynaBean dynaBean) throws DynaSqlException
connection
- The database connectionmodel
- The database model to usedynaBean
- The bean
DynaSqlException
public void insert(Database model, Collection dynaBeans) throws DynaSqlException
model
- The database model to usedynaBeans
- The beans to insert
DynaSqlException
public void insert(Connection connection, Database model, Collection dynaBeans) throws DynaSqlException
connection
- The database connectionmodel
- The database model to usedynaBeans
- The beans
DynaSqlException
public String getUpdateSql(Database model, DynaBean dynaBean)
model
- The database model to usedynaBean
- The bean
public void update(Database model, DynaBean dynaBean) throws DynaSqlException
model
- The database model to usedynaBean
- The bean
DynaSqlException
public void update(Connection connection, Database model, DynaBean dynaBean) throws DynaSqlException
connection
- The database connectionmodel
- The database model to usedynaBean
- The bean
DynaSqlException
public String getDeleteSql(Database model, DynaBean dynaBean)
model
- The database model to usedynaBean
- The bean
public void delete(Database model, DynaBean dynaBean) throws DynaSqlException
model
- The database model to usedynaBean
- The bean to delete
DynaSqlException
public void delete(Connection connection, Database model, DynaBean dynaBean) throws DynaSqlException
model
- The database model to usedynaBean
- The beanconnection
- The database connection
DynaSqlException
public Database readModelFromDatabase(String name) throws DynaSqlException
name
- The name of the resulting database; null
when the default name (the catalog)
is desired which might be null
itself though
DynaSqlException
- If an error occurred during reading the modelpublic Database readModelFromDatabase(String name, String catalog, String schema, String[] tableTypes) throws DynaSqlException
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
DynaSqlException
- If an error occurred during reading the modelpublic Database readModelFromDatabase(Connection connection, String name) throws DynaSqlException
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
DynaSqlException
- If an error occurred during reading the modelpublic Database readModelFromDatabase(Connection connection, String name, String catalog, String schema, String[] tableTypes) throws DynaSqlException
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
DynaSqlException
- If an error occurred during reading the model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |