Class CallQueryMechanism
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
-
- org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
-
- org.eclipse.persistence.internal.queries.CallQueryMechanism
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
StatementQueryMechanism
public class CallQueryMechanism extends DatasourceCallQueryMechanism
Purpose: Mechanism used for custom SQL and stored procedure queries.
Responsibilities: Executes the appropriate call.
- Since:
- TOPLink/Java 2.0
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
call, calls
-
Fields inherited from class org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
query
-
-
Constructor Summary
Constructors Constructor Description CallQueryMechanism()
CallQueryMechanism(DatabaseQuery query)
Initialize the state of the queryCallQueryMechanism(DatabaseQuery query, DatabaseCall call)
Initialize the state of the query
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureDatabaseCall(DatabaseCall call)
Set the call level query options into the call.DatabaseCall
getDatabaseCall()
Return the call.void
prepareCall()
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 configure the SQL call.void
prepareDeleteAll()
Pre-build configure the SQL call.void
prepareDeleteObject()
Pre-build configure the SQL call.void
prepareDoesExist(DatabaseField field)
Pre-build configure the SQL call.void
prepareExecute()
Pre-build configure the SQL call for an execute call.void
prepareExecuteSelect()
Pre-build configure the SQL call.protected void
prepareJoining(ObjectLevelReadQuery query)
Prepare the joining indexes if joining.void
prepareSelectAllRows()
Pre-build configure the SQL call.void
prepareSelectOneRow()
Pre-build configure the SQL call.void
prepareUpdateObject()
Pre-build configure the SQL call.void
setCallHasCustomSQLArguments()
INTERNAL: Configure the call to be a dynamic custom SQL call, so that it ignores the # token.void
unprepare()
Unprepare the call if required.protected void
updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery)
Update the foreign key fields when resolving a bi-directional reference in a UOW.void
updateForeignKeyFieldBeforeDelete()
Update the foreign key fields to null when resolving a deletion cycle.-
Methods inherited from class org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
addCall, clone, computeAndSetItemOffset, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, deleteObject, execute, executeCall, executeCall, executeDeferredCall, executeNoSelect, executeNoSelectCall, executeSelect, executeSelectCall, generateKeysExecuteNoSelect, getCall, getCalls, hasMultipleCalls, insertObject, isCallQueryMechanism, prepare, prepareExecuteNoSelect, prepareInsertObject, prepareReportQueryItems, prepareReportQuerySelectAllRows, prepareReportQuerySubSelect, prepareUpdateAll, selectAllReportQueryRows, selectAllRows, selectOneRow, selectResultSet, selectRowForDoesExist, setCall, setCalls, updateAll, updateAllUsingTempTables, updateObject
-
Methods inherited from class org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
addWriteLockFieldForInsert, buildSelectionCriteria, checkCacheForObject, clone, executeWrite, executeWriteWithChangeSet, getDescriptor, getExecutionSession, getModifyRow, getQuery, getReadObjectQuery, getSelectionCriteria, getSession, getTranslationRow, getWriteObjectQuery, insertObject, insertObjectForWrite, isExpressionQueryMechanism, isJPQLCallQueryMechanism, isQueryByExampleMechanism, isStatementQueryMechanism, performUserDefinedInsert, performUserDefinedUpdate, performUserDefinedWrite, registerObjectInIdentityMap, setQuery, shallowInsertObjectForWrite, updateForeignKeyFieldAfterInsert, updateObjectAndRowWithReturnRow, updateObjectAndRowWithSequenceNumber, updateObjectAndRowWithSequenceNumber, updateObjectForWrite, updateObjectForWriteWithChangeSet
-
-
-
-
Constructor Detail
-
CallQueryMechanism
public CallQueryMechanism()
-
CallQueryMechanism
public CallQueryMechanism(DatabaseQuery query)
Initialize the state of the query- Parameters:
query
- - owner of mechanism
-
CallQueryMechanism
public CallQueryMechanism(DatabaseQuery query, DatabaseCall call)
Initialize the state of the query- Parameters:
query
- - owner of mechanismcall
- - sql call
-
-
Method Detail
-
getDatabaseCall
public DatabaseCall getDatabaseCall()
Return the call.
-
unprepare
public void unprepare()
Unprepare the call if required. Clone and unprepare stored procedure calls, so they can be reprepared with possible different optional arguments.- Overrides:
unprepare
in classDatabaseQueryMechanism
-
prepareCall
public void prepareCall() throws QueryException
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. This query is copied for concurrency so this prepare can only setup things that will apply to any future execution of this query.- Overrides:
prepareCall
in classDatasourceCallQueryMechanism
- Throws:
QueryException
-
configureDatabaseCall
protected void configureDatabaseCall(DatabaseCall call)
Set the call level query options into the call.
-
prepareCursorSelectAllRows
public void prepareCursorSelectAllRows() throws QueryException
Pre-build configure the SQL call.- Overrides:
prepareCursorSelectAllRows
in classDatasourceCallQueryMechanism
- Throws:
QueryException
-
prepareDeleteAll
public void prepareDeleteAll()
Pre-build configure the SQL call.- Overrides:
prepareDeleteAll
in classDatasourceCallQueryMechanism
-
prepareDeleteObject
public void prepareDeleteObject()
Pre-build configure the SQL call.- Overrides:
prepareDeleteObject
in classDatasourceCallQueryMechanism
-
prepareDoesExist
public void prepareDoesExist(DatabaseField field)
Pre-build configure the SQL call.- Overrides:
prepareDoesExist
in classDatasourceCallQueryMechanism
-
prepareExecute
public void prepareExecute()
Pre-build configure the SQL call for an execute call.- Overrides:
prepareExecute
in classDatasourceCallQueryMechanism
-
prepareExecuteSelect
public void prepareExecuteSelect()
Pre-build configure the SQL call.- Overrides:
prepareExecuteSelect
in classDatasourceCallQueryMechanism
-
prepareSelectAllRows
public void prepareSelectAllRows()
Pre-build configure the SQL call.- Overrides:
prepareSelectAllRows
in classDatasourceCallQueryMechanism
-
prepareJoining
protected void prepareJoining(ObjectLevelReadQuery query)
Prepare the joining indexes if joining.
-
prepareSelectOneRow
public void prepareSelectOneRow()
Pre-build configure the SQL call.- Overrides:
prepareSelectOneRow
in classDatasourceCallQueryMechanism
-
prepareUpdateObject
public void prepareUpdateObject()
Pre-build configure the SQL call.- Overrides:
prepareUpdateObject
in classDatasourceCallQueryMechanism
-
setCallHasCustomSQLArguments
public void setCallHasCustomSQLArguments()
INTERNAL: Configure the call to be a dynamic custom SQL call, so that it ignores the # token.
-
updateForeignKeyFieldAfterInsert
protected void updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery)
Update the foreign key fields when resolving a bi-directional reference in a UOW. This must always be dynamic as it is called within an insert query and is really part of the insert and does not fire update events or worry about locking.- Overrides:
updateForeignKeyFieldAfterInsert
in classDatasourceCallQueryMechanism
-
updateForeignKeyFieldBeforeDelete
public void updateForeignKeyFieldBeforeDelete()
Update the foreign key fields to null when resolving a deletion cycle. This must always be dynamic as it is called within an delete query and is really part of the delete and does not fire update events or worry about locking.- Overrides:
updateForeignKeyFieldBeforeDelete
in classDatabaseQueryMechanism
-
-