public abstract class KKBasePeer
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IGNORE_CASE
Constant criteria key to remove Case Information from search/ordering criteria.
|
protected static org.apache.commons.logging.Log |
log
the log
|
static java.lang.String |
ORDER_BY
Constant criteria key to reference ORDER BY columns.
|
static java.lang.String |
TABLE_NAME
Classes that implement this class should override this value.
|
Constructor and Description |
---|
KKBasePeer() |
Modifier and Type | Method and Description |
---|---|
static void |
correctBooleans(org.apache.torque.util.Criteria criteria,
org.apache.torque.map.TableMap defaultTableMap)
Checks all columns in the criteria to see whether booleanchar and booleanint columns are
queried with a boolean.
|
static void |
createInsertQuery(KKCriteria criteria)
Create an INSERT query from the criteria.
|
static org.apache.torque.sql.Query |
createQuery(KKCriteria criteria)
Method to create an SQL query based on values in a Criteria.
|
static java.lang.String |
createQueryDisplayString(java.lang.String queryString,
java.util.List<java.lang.Object> replacements)
Create a String representation of the Prepared Statement
|
static java.lang.String |
createQueryString(KKCriteria criteria)
Method to create an SQL query for actual execution based on values in a Criteria.
|
static java.lang.String |
createUpdateQuery(KKCriteria selectC,
KKCriteria updateC)
Create an UPDATE query from the two criteria objects.
|
static void |
deleteAll(java.sql.Connection con,
java.lang.String table,
java.lang.String column,
int value)
Convenience method that uses straight JDBC to delete multiple rows.
|
static void |
deleteAll(java.lang.String table,
java.lang.String column,
int value)
Convenience method that uses straight JDBC to delete multiple rows.
|
static int |
doDelete(KKCriteria criteria,
java.lang.String tableName)
Method to perform deletes based on values and keys in a Criteria.
|
static int |
doDelete(KKCriteria criteria,
java.lang.String tableName,
java.sql.Connection con)
Method to perform deletes based on values and keys in a Criteria.
|
static org.apache.torque.om.ObjectKey |
doInsert(KKCriteria criteria)
Method to perform inserts based on values and keys in a Criteria.
|
static org.apache.torque.om.ObjectKey |
doInsert(KKCriteria criteria,
java.sql.Connection con)
Method to perform inserts based on values and keys in a Criteria.
|
static java.util.List<com.workingdogs.village.Record> |
doSelect(KKCriteria criteria)
Returns all results.
|
static java.util.List<com.workingdogs.village.Record> |
doSelect(KKCriteria criteria,
java.sql.Connection connection)
Performs a SQL
select using a PreparedStatement. |
static java.util.List<com.workingdogs.village.Record> |
doSelect(KKCriteria criteria,
int retryMax)
Returns all results.
|
static int |
doUpdate(KKCriteria updateValues)
Convenience method used to update rows in the DB.
|
static int |
doUpdate(KKCriteria updateValues,
java.sql.Connection con)
Convenience method used to update rows in the DB.
|
static int |
doUpdate(KKCriteria selectC,
KKCriteria updateC)
Method used to update rows in the DB.
|
static int |
doUpdate(KKCriteria criteria,
KKCriteria updateValues,
java.sql.Connection con)
Method used to update rows in the DB.
|
static int |
doUpdate(KKCriteria selectC,
KKCriteria updateC,
int retryMax)
Method used to update rows in the DB.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString)
Utility method which executes a given sql statement.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
boolean singleRecord,
java.sql.Connection con)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
int start,
int numberOfResults,
boolean singleRecord,
java.sql.Connection con)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
int start,
int numberOfResults,
java.lang.String dbName,
boolean singleRecord)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.util.List<java.lang.Object> whereValues)
Utility method which executes a given sql statement.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.util.List<java.lang.Object> whereValues,
boolean singleRecord,
java.sql.Connection con)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.util.List<java.lang.Object> whereValues,
int start,
int numberOfResults,
boolean singleRecord,
java.sql.Connection con)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.util.List<java.lang.Object> whereValues,
int start,
int numberOfResults,
java.lang.String dbName,
boolean singleRecord)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.util.List<java.lang.Object> whereValues,
java.lang.String dbName)
Utility method which executes a given sql statement.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.util.List<java.lang.Object> whereValues,
java.lang.String dbName,
boolean singleRecord)
Method for performing a SELECT.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.lang.String dbName)
Utility method which executes a given sql statement.
|
static java.util.List<com.workingdogs.village.Record> |
executeQuery(java.lang.String queryString,
java.lang.String dbName,
boolean singleRecord)
Method for performing a SELECT.
|
static int |
executeStatement(java.lang.String statementString)
Utility method which executes a given sql statement.
|
static int |
executeStatement(java.lang.String statementString,
java.sql.Connection con)
Utility method which executes a given sql statement.
|
static int |
executeStatement(java.lang.String statementString,
java.lang.String dbName)
Utility method which executes a given sql statement.
|
static java.util.List<com.workingdogs.village.Record> |
getSelectResults(com.workingdogs.village.QueryDataSet qds)
Returns all records in a QueryDataSet as a List of Record objects.
|
static java.util.List<com.workingdogs.village.Record> |
getSelectResults(com.workingdogs.village.QueryDataSet qds,
boolean singleRecord)
Returns all records in a QueryDataSet as a List of Record objects.
|
static java.util.List<com.workingdogs.village.Record> |
getSelectResults(com.workingdogs.village.QueryDataSet qds,
int numberOfResults,
boolean singleRecord)
Returns numberOfResults records in a QueryDataSet as a List of Record objects.
|
static java.util.List<com.workingdogs.village.Record> |
getSelectResults(com.workingdogs.village.QueryDataSet qds,
int start,
int numberOfResults,
boolean singleRecord)
Returns numberOfResults records in a QueryDataSet as a List of Record objects.
|
static org.apache.torque.map.TableMap |
getTableMap(KKCriteria criteria) |
static org.apache.torque.map.TableMap |
getTableMap(KKCriteria criteria,
java.lang.String defTableName) |
protected static void |
handleMultipleRecords(com.workingdogs.village.DataSet ds)
If the user specified that (s)he only wants to retrieve a single record and multiple records
are retrieved, this method is called to handle the situation.
|
static java.lang.String[] |
initColumnNames(com.workingdogs.village.Column[] columns)
Convenience method to create a String array of column names.
|
static java.lang.String[] |
initCriteriaKeys(java.lang.String tableName,
java.lang.String[] columnNames)
Convenience method to create a String array of criteria keys.
|
static com.workingdogs.village.Column[] |
initTableColumns(com.workingdogs.village.Schema schema)
Creates a Column array for a table based on its Schema.
|
static com.workingdogs.village.Schema |
initTableSchema(java.lang.String tableName)
Sets up a Schema for a table.
|
static com.workingdogs.village.Schema |
initTableSchema(java.lang.String tableName,
java.lang.String dbName)
Sets up a Schema for a table.
|
static boolean |
isDataTooLongException(java.lang.String eMsg)
Test to see whether the exception message contains some key strings that indicate that a
"data too long" problem has occurred.
|
static boolean |
isDB2()
Are we using DB2?
|
static boolean |
isDeadlockException(java.sql.SQLException se)
Does this exception indicate a deadlock?
|
static boolean |
isMSSqlServer()
Are we using SQL Server?
|
static boolean |
isMySql()
Are we using MySQL?
|
static boolean |
isOracle()
Are we using Oracle?
|
static boolean |
isPostgreSQL()
Are we using PostgreSQL?
|
static java.lang.String |
jdbcValueToString(org.apache.torque.util.JdbcTypedValue jdbcVal)
Get a String representation of the JDBC value
|
static java.util.List<com.workingdogs.village.Record> |
select(KKCriteria selectC)
Return a list of Record objects by executing the query defined by the criteria object
|
public static final java.lang.String ORDER_BY
public static final java.lang.String IGNORE_CASE
public static final java.lang.String TABLE_NAME
protected static final org.apache.commons.logging.Log log
public static com.workingdogs.village.Schema initTableSchema(java.lang.String tableName)
tableName
- The name of the table.public static com.workingdogs.village.Schema initTableSchema(java.lang.String tableName, java.lang.String dbName)
tableName
- The property name for the database in the configuration file.dbName
- The name of the database.public static com.workingdogs.village.Column[] initTableColumns(com.workingdogs.village.Schema schema)
schema
- A Schema object.public static java.lang.String[] initColumnNames(com.workingdogs.village.Column[] columns)
columns
- A Column[].public static java.lang.String[] initCriteriaKeys(java.lang.String tableName, java.lang.String[] columnNames)
tableName
- Name of table.columnNames
- A String[].public static void deleteAll(java.sql.Connection con, java.lang.String table, java.lang.String column, int value) throws org.apache.torque.TorqueException
con
- A Connection.table
- The table to delete records from.column
- The column in the where clause.value
- The value of the column.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static void deleteAll(java.lang.String table, java.lang.String column, int value) throws org.apache.torque.TorqueException
table
- The table to delete records from.column
- The column in the where clause.value
- The value of the column.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static int doDelete(KKCriteria criteria, java.lang.String tableName) throws org.apache.torque.TorqueException
criteria
- The criteria to use.tableName
- the name of the table to delete records from. If set to null, the name of the
table(s) can be extracted from the criteria, but this can cause unexpected
results.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static int doDelete(KKCriteria criteria, java.lang.String tableName, java.sql.Connection con) throws org.apache.torque.TorqueException
criteria
- The criteria to use.tableName
- the tableName to delete records from. If set to null, the name of the table(s) can
be extracted from the criteria, but this can cause unexpected results.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static org.apache.torque.om.ObjectKey doInsert(KKCriteria criteria) throws org.apache.torque.TorqueException
If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned.
If the primary key is included in Criteria then that value will be used to insert the row.
If no primary key is included in Criteria then we will try to figure out the primary key from the database map and insert the row with the next available id using util.db.IDBroker.
If no primary key is defined for the table the values will be inserted as specified in Criteria and -1 will be returned.
criteria
- Object containing values to insert.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static org.apache.torque.om.ObjectKey doInsert(KKCriteria criteria, java.sql.Connection con) throws org.apache.torque.TorqueException
If the primary key is auto incremented the data in Criteria will be inserted and the auto increment value will be returned.
If the primary key is included in Criteria then that value will be used to insert the row.
If no primary key is included in Criteria then we will try to figure out the primary key from the database map and insert the row with the next available id using util.db.IDBroker.
If no primary key is defined for the table the values will be inserted as specified in Criteria and null will be returned.
criteria
- Object containing values to insert.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static void createInsertQuery(KKCriteria criteria)
criteria
- the criteriapublic static java.lang.String jdbcValueToString(org.apache.torque.util.JdbcTypedValue jdbcVal)
jdbcVal
- the jdbcValpublic static org.apache.torque.map.TableMap getTableMap(KKCriteria criteria, java.lang.String defTableName) throws org.apache.torque.TorqueException
criteria
- the criteriadefTableName
- Use this default table name if another one can't be derivedorg.apache.torque.TorqueException
- an unexpected TorqueException exceptionpublic static org.apache.torque.map.TableMap getTableMap(KKCriteria criteria) throws org.apache.torque.TorqueException
criteria
- the criteriaorg.apache.torque.TorqueException
- an unexpected TorqueException exceptionpublic static java.lang.String createQueryDisplayString(java.lang.String queryString, java.util.List<java.lang.Object> replacements)
queryString
- the queryStringreplacements
- the replacementspublic static java.lang.String createQueryString(KKCriteria criteria) throws org.apache.torque.TorqueException
criteria
- A Criteria.org.apache.torque.TorqueException
- Trouble creating the query string.public static org.apache.torque.sql.Query createQuery(KKCriteria criteria) throws org.apache.torque.TorqueException
criteria
- A Criteria.org.apache.torque.TorqueException
- Trouble creating the query string.public static java.util.List<com.workingdogs.village.Record> doSelect(KKCriteria criteria) throws org.apache.torque.TorqueException
criteria
- A Criteria.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> doSelect(KKCriteria criteria, int retryMax) throws org.apache.torque.TorqueException
criteria
- A Criteria.retryMax
- Maximum retries that will be attempted if we get deadlock exceptions - only
applicable on MS SQL Server and DB2org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> doSelect(KKCriteria criteria, java.sql.Connection connection) throws org.apache.torque.TorqueException
select
using a PreparedStatement.criteria
- A Criteria specifying the records to select, not null.connection
- the database connection for selecting records, not null.org.apache.torque.TorqueException
- Error performing database query.public static boolean isDeadlockException(java.sql.SQLException se)
se
- SQLExceptionpublic static boolean isDataTooLongException(java.lang.String eMsg)
eMsg
- The Exception messagepublic static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.lang.String dbName) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.dbName
- The database to connect to.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.util.List<java.lang.Object> whereValues) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.whereValues
- values for replacement in the prepared statementorg.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.util.List<java.lang.Object> whereValues, java.lang.String dbName) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.whereValues
- values for replacement in the prepared statementdbName
- The database to connect to.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.lang.String dbName, boolean singleRecord) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.dbName
- The database to connect to.singleRecord
- Whether or not we want to select only a single record.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.util.List<java.lang.Object> whereValues, java.lang.String dbName, boolean singleRecord) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.whereValues
- values for replacement in the prepared statementdbName
- The database to connect to.singleRecord
- Whether or not we want to select only a single record.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, boolean singleRecord, java.sql.Connection con) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.singleRecord
- Whether or not we want to select only a single record.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.util.List<java.lang.Object> whereValues, boolean singleRecord, java.sql.Connection con) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.whereValues
- values for replacement in the prepared statementsingleRecord
- Whether or not we want to select only a single record.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, int start, int numberOfResults, java.lang.String dbName, boolean singleRecord) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.start
- The first row to return.numberOfResults
- The number of rows to return.dbName
- The database to connect to.singleRecord
- Whether or not we want to select only a single record.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.util.List<java.lang.Object> whereValues, int start, int numberOfResults, java.lang.String dbName, boolean singleRecord) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.whereValues
- the where clause values used in prepared statementsstart
- The first row to return.numberOfResults
- The number of rows to return.dbName
- The database to connect to.singleRecord
- Whether or not we want to select only a single record.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, int start, int numberOfResults, boolean singleRecord, java.sql.Connection con) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.start
- The first row to return.numberOfResults
- The number of rows to return.singleRecord
- Whether or not we want to select only a single record.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> executeQuery(java.lang.String queryString, java.util.List<java.lang.Object> whereValues, int start, int numberOfResults, boolean singleRecord, java.sql.Connection con) throws org.apache.torque.TorqueException
queryString
- A String with the sql statement to execute.start
- The first row to return.numberOfResults
- The number of rows to return.singleRecord
- Whether or not we want to select only a single record.whereValues
- the where clause values used in prepared statementscon
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static java.util.List<com.workingdogs.village.Record> getSelectResults(com.workingdogs.village.QueryDataSet qds) throws org.apache.torque.TorqueException
qds
- the QueryDataSetorg.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.getSelectResults(QueryDataSet, int, int, boolean)
public static java.util.List<com.workingdogs.village.Record> getSelectResults(com.workingdogs.village.QueryDataSet qds, boolean singleRecord) throws org.apache.torque.TorqueException
qds
- the QueryDataSetsingleRecord
- the singleRecordorg.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.getSelectResults(QueryDataSet, int, int, boolean)
public static java.util.List<com.workingdogs.village.Record> getSelectResults(com.workingdogs.village.QueryDataSet qds, int numberOfResults, boolean singleRecord) throws org.apache.torque.TorqueException
qds
- the QueryDataSetnumberOfResults
- the numberOfResultssingleRecord
- the singleRecordorg.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.getSelectResults(QueryDataSet, int, int, boolean)
public static java.util.List<com.workingdogs.village.Record> getSelectResults(com.workingdogs.village.QueryDataSet qds, int start, int numberOfResults, boolean singleRecord) throws org.apache.torque.TorqueException
qds
- The QueryDataSet
to extract results from.start
- The index from which to start retrieving Record
objects from the data
set.numberOfResults
- The number of results to return (or -1
for all results).singleRecord
- Whether or not we want to select only a single record.List
of Record
objects.org.apache.torque.TorqueException
- If any Exception
occurs.public static int doUpdate(KKCriteria updateValues) throws org.apache.torque.TorqueException
Use this method for performing an update of the kind:
"WHERE primary_key_id = an int"
To perform an update with non-primary key fields in the WHERE clause use doUpdate(criteria, criteria).
updateValues
- A Criteria object containing values used in set clause.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static int doUpdate(KKCriteria updateValues, java.sql.Connection con) throws org.apache.torque.TorqueException
Use this method for performing an update of the kind:
"WHERE primary_key_id = an int"
To perform an update with non-primary key fields in the WHERE clause use doUpdate(criteria, criteria).
updateValues
- A Criteria object containing values used in set clause.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static int doUpdate(KKCriteria selectC, KKCriteria updateC) throws org.apache.torque.TorqueException
Use this method for performing an update of the kind:
WHERE some_column = some value AND could_have_another_column = another value AND so on...
selectC
- A Criteria object containing values used in where clause.updateC
- A Criteria object containing values used in set clause.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static int doUpdate(KKCriteria selectC, KKCriteria updateC, int retryMax) throws org.apache.torque.TorqueException
Use this method for performing an update of the kind:
WHERE some_column = some value AND could_have_another_column = another value AND so on...
selectC
- A Criteria object containing values used in where clause.updateC
- A Criteria object containing values used in set clause.retryMax
- Maximum retries that will be attempted if we get deadlock exceptions - only
applicable on MS SQL Server and DB2org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static int doUpdate(KKCriteria criteria, KKCriteria updateValues, java.sql.Connection con) throws org.apache.torque.TorqueException
Use this method for performing an update of the kind:
WHERE some_column = some value AND could_have_another_column = another value AND so on.
criteria
- A Criteria object containing values used in where clause.updateValues
- A Criteria object containing values used in set clause.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static java.lang.String createUpdateQuery(KKCriteria selectC, KKCriteria updateC) throws org.apache.torque.TorqueException
selectC
- the selectCupdateC
- the updateCorg.apache.torque.TorqueException
- an unexpected TorqueException exceptionpublic static int executeStatement(java.lang.String statementString) throws org.apache.torque.TorqueException
statementString
- A String with the sql statement to execute.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.public static int executeStatement(java.lang.String statementString, java.lang.String dbName) throws org.apache.torque.TorqueException
statementString
- A String with the sql statement to execute.dbName
- Name of database to connect to.org.apache.torque.TorqueException
- Any exceptions caught during processing will be rethrown wrapped into a
TorqueException.public static int executeStatement(java.lang.String statementString, java.sql.Connection con) throws org.apache.torque.TorqueException
statementString
- A String with the sql statement to execute.con
- A Connection.org.apache.torque.TorqueException
- Any exceptions caught during processing will be re-thrown wrapped into a
TorqueException.protected static void handleMultipleRecords(com.workingdogs.village.DataSet ds) throws org.apache.torque.TorqueException
ds
- The DataSet which contains multiple records.org.apache.torque.TorqueException
- Couldn't handle multiple records.public static void correctBooleans(org.apache.torque.util.Criteria criteria, org.apache.torque.map.TableMap defaultTableMap) throws org.apache.torque.TorqueException
criteria
- The criteria to be checked for booleanint and booleanchar columns.defaultTableMap
- the table map to be used if the table name is not given in a column.org.apache.torque.TorqueException
- if the database map for the criteria cannot be retrieved.public static boolean isDB2()
public static boolean isPostgreSQL()
public static boolean isOracle()
public static boolean isMySql()
public static boolean isMSSqlServer()
public static java.util.List<com.workingdogs.village.Record> select(KKCriteria selectC) throws org.apache.torque.TorqueException
selectC
- select criteria objectorg.apache.torque.TorqueException
- an unexpected TorqueException exceptionCopyright © 2018 DS Data Systems UK Ltd.