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 Vector |
sqlStatements
Normally only a single statement is used, however multiple table may require multiple statements on write.
|
call, calls
query
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.
|
Integer |
deleteObject()
INTERNAL:
delete the object
|
Integer |
executeNoSelect()
Update the object
|
Expression |
getSelectionCriteria()
Return the selection criteria for the statement.
|
SQLStatement |
getSQLStatement()
INTERNAL:
Return the sqlStatement
|
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(Vector sqlStatements)
Normally only a single statement is used, however multiple table may require multiple statements on write.
|
Integer |
updateObject()
Update the object
|
getDatabaseCall, prepareCall, setCallHasCustomSQLArguments, updateForeignKeyFieldShallow
addCall, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, executeCall, executeCall, executeNoSelectCall, executeSelect, executeSelectCall, getCall, getCalls, hasMultipleCalls, prepareReportQueryItems, prepareReportQuerySelectAllRows, prepareReportQuerySubSelect, selectAllReportQueryRows, selectAllRows, selectOneRow, selectRowForDoesExist, setCall, setCalls, updateAll, updateAllUsingTempTables
addObjectDeletedDuringCommit, 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, updateObjectForWriteWithChangeSet
protected SQLStatement sqlStatement
protected 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 DatabaseQueryMechanism
public Integer deleteObject() throws DatabaseException
deleteObject
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the database.public Integer executeNoSelect() throws DatabaseException
executeNoSelect
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the database.public Expression getSelectionCriteria()
getSelectionCriteria
in class DatabaseQueryMechanism
public SQLStatement getSQLStatement()
public Vector getSQLStatements()
public boolean hasMultipleStatements()
public void insertObject() throws DatabaseException
insertObject
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the database.public void insertObject(boolean reprepare)
insertObject
in class DatabaseQueryMechanism
boolean
- reprepare - whether to reprepare the query.public boolean isCallQueryMechanism()
isCallQueryMechanism
in class DatasourceCallQueryMechanism
public boolean isStatementQueryMechanism()
isStatementQueryMechanism
in class DatabaseQueryMechanism
public void prepare()
prepare
in class DatasourceCallQueryMechanism
public void prepareCursorSelectAllRows()
prepareCursorSelectAllRows
in class DatasourceCallQueryMechanism
public void prepareDeleteAll()
prepareDeleteAll
in class CallQueryMechanism
public void prepareDeleteObject()
prepareDeleteObject
in class CallQueryMechanism
public void prepareDoesExist(DatabaseField field)
prepareDoesExist
in class CallQueryMechanism
public void prepareExecuteNoSelect()
prepareExecuteNoSelect
in class DatasourceCallQueryMechanism
public void prepareExecuteSelect()
prepareExecuteSelect
in class CallQueryMechanism
public void prepareInsertObject()
prepareInsertObject
in class DatasourceCallQueryMechanism
public void prepareSelectAllRows()
prepareSelectAllRows
in class CallQueryMechanism
public void prepareSelectOneRow()
prepareSelectOneRow
in class CallQueryMechanism
public void prepareUpdateObject()
prepareUpdateObject
in class CallQueryMechanism
public void prepareUpdateAll()
prepareUpdateAll
in class DatasourceCallQueryMechanism
protected void setCallFromStatement()
public void setSQLStatement(SQLStatement statement)
protected void setSQLStatements(Vector sqlStatements)
public Integer updateObject() throws DatabaseException
updateObject
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the database.Copyright © 2021. All rights reserved.