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 voidconfigureDatabaseCall(DatabaseCall call)Set the call level query options into the call.DatabaseCallgetDatabaseCall()Return the call.voidprepareCall()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.voidprepareCursorSelectAllRows()Pre-build configure the SQL call.voidprepareDeleteAll()Pre-build configure the SQL call.voidprepareDeleteObject()Pre-build configure the SQL call.voidprepareDoesExist(DatabaseField field)Pre-build configure the SQL call.voidprepareExecute()Pre-build configure the SQL call for an execute call.voidprepareExecuteSelect()Pre-build configure the SQL call.protected voidprepareJoining(ObjectLevelReadQuery query)Prepare the joining indexes if joining.voidprepareSelectAllRows()Pre-build configure the SQL call.voidprepareSelectOneRow()Pre-build configure the SQL call.voidprepareUpdateObject()Pre-build configure the SQL call.voidsetCallHasCustomSQLArguments()INTERNAL: Configure the call to be a dynamic custom SQL call, so that it ignores the # token.voidunprepare()Unprepare the call if required.protected voidupdateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery)Update the foreign key fields when resolving a bi-directional reference in a UOW.voidupdateForeignKeyFieldBeforeDelete()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:
unpreparein classDatabaseQueryMechanism
-
prepareCall
public void prepareCall() throws QueryExceptionINTERNAL: 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:
prepareCallin classDatasourceCallQueryMechanism- Throws:
QueryException
-
configureDatabaseCall
protected void configureDatabaseCall(DatabaseCall call)
Set the call level query options into the call.
-
prepareCursorSelectAllRows
public void prepareCursorSelectAllRows() throws QueryExceptionPre-build configure the SQL call.- Overrides:
prepareCursorSelectAllRowsin classDatasourceCallQueryMechanism- Throws:
QueryException
-
prepareDeleteAll
public void prepareDeleteAll()
Pre-build configure the SQL call.- Overrides:
prepareDeleteAllin classDatasourceCallQueryMechanism
-
prepareDeleteObject
public void prepareDeleteObject()
Pre-build configure the SQL call.- Overrides:
prepareDeleteObjectin classDatasourceCallQueryMechanism
-
prepareDoesExist
public void prepareDoesExist(DatabaseField field)
Pre-build configure the SQL call.- Overrides:
prepareDoesExistin classDatasourceCallQueryMechanism
-
prepareExecute
public void prepareExecute()
Pre-build configure the SQL call for an execute call.- Overrides:
prepareExecutein classDatasourceCallQueryMechanism
-
prepareExecuteSelect
public void prepareExecuteSelect()
Pre-build configure the SQL call.- Overrides:
prepareExecuteSelectin classDatasourceCallQueryMechanism
-
prepareSelectAllRows
public void prepareSelectAllRows()
Pre-build configure the SQL call.- Overrides:
prepareSelectAllRowsin classDatasourceCallQueryMechanism
-
prepareJoining
protected void prepareJoining(ObjectLevelReadQuery query)
Prepare the joining indexes if joining.
-
prepareSelectOneRow
public void prepareSelectOneRow()
Pre-build configure the SQL call.- Overrides:
prepareSelectOneRowin classDatasourceCallQueryMechanism
-
prepareUpdateObject
public void prepareUpdateObject()
Pre-build configure the SQL call.- Overrides:
prepareUpdateObjectin 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:
updateForeignKeyFieldAfterInsertin 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:
updateForeignKeyFieldBeforeDeletein classDatabaseQueryMechanism
-
-