public class StatementQueryMechanism extends CallQueryMechanism
Purpose: Mechanism used for all statement objects.
Responsibilities: Executes the appropriate statement.
| Modifier and Type | Field and Description |
|---|---|
protected SQLStatement |
sqlStatement |
protected java.util.Vector |
sqlStatements
Normally only a single statement is used, however multiple table may require multiple statements on write.
|
call, callsquery| Constructor and Description |
|---|
StatementQueryMechanism(DatabaseQuery query)
INTERNAL:
Return a new mechanism for the query
|
StatementQueryMechanism(DatabaseQuery query,
SQLStatement statement)
Return a new mechanism for the query
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearStatement()
The statement is no longer require after prepare so can be released.
|
DatabaseQueryMechanism |
clone(DatabaseQuery queryClone)
Clone the mechanism for the specified query clone.
|
java.lang.Integer |
deleteObject()
INTERNAL:
delete the object
|
java.lang.Integer |
executeNoSelect()
Update the object
|
Expression |
getSelectionCriteria()
Return the selection criteria for the statement.
|
SQLStatement |
getSQLStatement()
INTERNAL:
Return the sqlStatement
|
java.util.Vector |
getSQLStatements()
Normally only a single statement is used, however multiple table may require multiple statements on write.
|
boolean |
hasMultipleStatements()
Normally only a single statement is used, however multiple table may require multiple statements on write.
|
void |
insertObject()
Insert the object
|
void |
insertObject(boolean reprepare)
Insert the object if the reprepare flag is set, first reprepare the query.
|
boolean |
isCallQueryMechanism()
Return true if this is a call query mechanism
|
boolean |
isStatementQueryMechanism()
Return true if this is a statement query mechanism
|
void |
prepare()
INTERNAL:
This is different from 'prepareForExecution' in that this is called on the original query,
and the other is called on the copy of the query.
|
void |
prepareCursorSelectAllRows()
Pre-build the SQL call from the statement.
|
void |
prepareDeleteAll()
Pre-build the SQL call from the statement.
|
void |
prepareDeleteObject()
Pre-build the SQL call from the statement.
|
void |
prepareDoesExist(DatabaseField field)
Pre-build the SQL call from the statement.
|
void |
prepareExecuteNoSelect()
Pre-build the SQL call from the statement.
|
void |
prepareExecuteSelect()
Pre-build the SQL call from the statement.
|
void |
prepareInsertObject()
Pre-build the SQL call from the statement.
|
void |
prepareSelectAllRows()
Pre-build the SQL call from the statement.
|
void |
prepareSelectOneRow()
Pre-build the SQL call from the statement.
|
void |
prepareUpdateAll()
Pre-build the SQL call from the statement.
|
void |
prepareUpdateObject()
Pre-build the SQL call from the statement.
|
protected void |
setCallFromStatement()
Pre-build the SQL call from the statement.
|
void |
setSQLStatement(SQLStatement statement)
Set the sqlStatement
|
protected void |
setSQLStatements(java.util.Vector sqlStatements)
Normally only a single statement is used, however multiple table may require multiple statements on write.
|
java.lang.Integer |
updateObject()
Update the object
|
getDatabaseCall, prepareCall, setCallHasCustomSQLArguments, updateForeignKeyFieldShallowaddCall, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, executeCall, executeCall, executeNoSelectCall, executeSelect, executeSelectCall, getCall, getCalls, hasMultipleCalls, prepareReportQueryItems, prepareReportQuerySelectAllRows, prepareReportQuerySubSelect, selectAllReportQueryRows, selectAllRows, selectOneRow, selectRowForDoesExist, setCall, setCalls, updateAll, updateAllUsingTempTablesaddObjectDeletedDuringCommit, addWriteLockFieldForInsert, buildObjectsFromRows, buildSelectionCriteria, checkCacheForObject, clone, deleteObjectForWrite, executeWrite, executeWriteWithChangeSet, getDescriptor, getModifyRow, getQuery, getReadObjectQuery, getSession, getTranslationRow, getWriteObjectQuery, insertObjectForWrite, insertObjectForWriteWithChangeSet, isEJBQLCallQueryMechanism, isExpressionQueryMechanism, isQueryByExampleMechanism, performUserDefinedDelete, performUserDefinedInsert, performUserDefinedUpdate, performUserDefinedWrite, prepareForExecution, registerObjectInIdentityMap, setQuery, shallowDeleteObjectForWrite, shallowInsertObjectForWrite, updateChangeSet, updateChangeSet, updateChangeSet, updateChangeSet, updateForeignKeyFieldAfterInsert, updateForeignKeyFieldBeforeDelete, updateObjectAndRowWithReturnRow, updateObjectAndRowWithSequenceNumber, updateObjectForWrite, updateObjectForWriteWithChangeSetprotected SQLStatement sqlStatement
protected java.util.Vector sqlStatements
public StatementQueryMechanism(DatabaseQuery query)
query - - owner of mechanismpublic StatementQueryMechanism(DatabaseQuery query, SQLStatement statement)
query - - owner of mechanismstatement - - sql statementpublic void clearStatement()
public DatabaseQueryMechanism clone(DatabaseQuery queryClone)
clone in class DatabaseQueryMechanismpublic java.lang.Integer deleteObject()
throws DatabaseException
deleteObject in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the database.public java.lang.Integer executeNoSelect()
throws DatabaseException
executeNoSelect in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the database.public Expression getSelectionCriteria()
getSelectionCriteria in class DatabaseQueryMechanismpublic SQLStatement getSQLStatement()
public java.util.Vector getSQLStatements()
public boolean hasMultipleStatements()
public void insertObject()
throws DatabaseException
insertObject in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the database.public void insertObject(boolean reprepare)
insertObject in class DatabaseQueryMechanismboolean - reprepare - whether to reprepare the query.public boolean isCallQueryMechanism()
isCallQueryMechanism in class DatasourceCallQueryMechanismpublic boolean isStatementQueryMechanism()
isStatementQueryMechanism in class DatabaseQueryMechanismpublic void prepare()
prepare in class DatasourceCallQueryMechanismpublic void prepareCursorSelectAllRows()
prepareCursorSelectAllRows in class DatasourceCallQueryMechanismpublic void prepareDeleteAll()
prepareDeleteAll in class CallQueryMechanismpublic void prepareDeleteObject()
prepareDeleteObject in class CallQueryMechanismpublic void prepareDoesExist(DatabaseField field)
prepareDoesExist in class CallQueryMechanismpublic void prepareExecuteNoSelect()
prepareExecuteNoSelect in class DatasourceCallQueryMechanismpublic void prepareExecuteSelect()
prepareExecuteSelect in class CallQueryMechanismpublic void prepareInsertObject()
prepareInsertObject in class DatasourceCallQueryMechanismpublic void prepareSelectAllRows()
prepareSelectAllRows in class CallQueryMechanismpublic void prepareSelectOneRow()
prepareSelectOneRow in class CallQueryMechanismpublic void prepareUpdateObject()
prepareUpdateObject in class CallQueryMechanismpublic void prepareUpdateAll()
prepareUpdateAll in class DatasourceCallQueryMechanismprotected void setCallFromStatement()
public void setSQLStatement(SQLStatement statement)
protected void setSQLStatements(java.util.Vector sqlStatements)
public java.lang.Integer updateObject()
throws DatabaseException
updateObject in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the database.