Module org.eclipse.persistence.core
Class DatasourceCallQueryMechanism
java.lang.Object
org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
CallQueryMechanism
Purpose: Mechanism used for call queries.
Responsibilities: Executes the appropriate call.
- Since:
- OracleAS TopLink 10g (10.0.3)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DatasourceCall
protected Vector
Normally only a single call is used, however multiple table may require multiple calls on write.Fields inherited from class org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
query
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize the state of the queryDatasourceCallQueryMechanism
(DatabaseQuery query, DatasourceCall call) Initialize the state of the query -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCall
(DatasourceCall call) Add the call.clone
(DatabaseQuery queryClone) Clone the DatasourceCall andVector<DatasourceCall>
.protected int
computeAndSetItemOffset
(ReportQuery query, List<ReportItem> items, int itemOffset) calculate indexes for given items, given the current OffsetRead all rows from the database using a cursored stream.INTERNAL: Delete a collection of objects.Execute deleteAll using temp tablesINTERNAL: Delete an object.execute()
INTERNAL: Execute a call.protected Object
Execute the call.protected Object
executeCall
(DatasourceCall databaseCall) Execute the call.void
Execute the call that was deferred to the commit manager.Execute a non selecting call.Execute a non selecting call.INTERNAL: Execute a selecting call.INTERNAL: Execute a selecting call.Execute a non selecting call.getCall()
Return the call.getCalls()
Normally only a single call is used, however multiple table may require multiple calls on write.boolean
Normally only a single call is used, however multiple table may require multiple calls on write.void
Insert the object.boolean
Return true if this is a call query mechanismvoid
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
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
Pre-build configure the call.void
Pre-build configure the call.void
Pre-build configure the call.void
prepareDoesExist
(DatabaseField field) Pre-build configure the call.void
Pre-build configure the call.void
Pre-build configure the call.void
Pre-build configure the call.void
Pre-build configure the call.protected void
Prepare the report items.void
Pre-build configure the call.void
Prepare for a sub select using a call.void
Pre-build configure the call.void
Pre-build configure the call.void
Pre-build configure the call.void
Pre-build configure the call.Read all rows from the database.Read all rows from the database.Read a single row from the database.Read all rows from the database, return ResultSetPerform a does exist checkvoid
setCall
(DatasourceCall call) Set the call.protected void
Normally only a single call is used, however multiple table may require multiple calls on write.Update the rows on the database.Execute updateAll using temp tablesprotected void
updateForeignKeyFieldAfterInsert
(WriteObjectQuery writeQuery) Update the foreign key fields when resolving a bi-directional reference in a UOW.Update the object.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, unprepare, updateForeignKeyFieldAfterInsert, updateForeignKeyFieldBeforeDelete, updateObjectAndRowWithReturnRow, updateObjectAndRowWithSequenceNumber, updateObjectAndRowWithSequenceNumber, updateObjectForWrite, updateObjectForWriteWithChangeSet
-
Field Details
-
call
-
calls
Normally only a single call is used, however multiple table may require multiple calls on write.
-
-
Constructor Details
-
DatasourceCallQueryMechanism
public DatasourceCallQueryMechanism() -
DatasourceCallQueryMechanism
Initialize the state of the query- Parameters:
query
- - owner of mechanism
-
DatasourceCallQueryMechanism
Initialize the state of the query- Parameters:
query
- - owner of mechanism
-
-
Method Details
-
addCall
Add the call. -
clone
Clone the DatasourceCall andVector<DatasourceCall>
.- Overrides:
clone
in classDatabaseQueryMechanism
-
cursorSelectAllRows
Read all rows from the database using a cursored stream.- Specified by:
cursorSelectAllRows
in classDatabaseQueryMechanism
- Throws:
DatabaseException
- - an error has occurred on the database
-
selectResultSet
Read all rows from the database, return ResultSet- Throws:
DatabaseException
- - an error has occurred on the database
-
deleteAll
INTERNAL: Delete a collection of objects. Assume call is correct.- Specified by:
deleteAll
in classDatabaseQueryMechanism
- Throws:
DatabaseException
- - an error has occurred on the database
-
deleteAllUsingTempTables
Execute deleteAll using temp tables- Returns:
- the row count.
- Throws:
DatabaseException
- - an error has occurred on the database.
-
deleteObject
INTERNAL: Delete an object. Assume call is correct- Specified by:
deleteObject
in classDatabaseQueryMechanism
- Returns:
- the row count.
- Throws:
DatabaseException
- - an error has occurred on the database
-
execute
INTERNAL: Execute a call.- Specified by:
execute
in classDatabaseQueryMechanism
- Returns:
- true if the first result is a result set and false if it is an update count or there are no results other than through INOUT and OUT parameterts, if any.
- Throws:
DatabaseException
- - an error has occurred on the database
-
executeCall
Execute the call. It is assumed the call has been fully prepared.- Throws:
DatabaseException
- - an error has occurred on the database.
-
executeCall
Execute the call. It is assumed the call has been fully prepared.- Throws:
DatabaseException
- - an error has occurred on the database.
-
executeNoSelect
Execute a non selecting call.- Specified by:
executeNoSelect
in classDatabaseQueryMechanism
- Returns:
- Returns either a
DatabaseCall
or Integer value, depending on if this INSERT call needs to return generated keys - Throws:
DatabaseException
- - an error has occurred on the database.
-
generateKeysExecuteNoSelect
Execute a non selecting call.- Specified by:
generateKeysExecuteNoSelect
in classDatabaseQueryMechanism
- Returns:
- the row count.
- Throws:
DatabaseException
- - an error has occurred on the database.
-
executeNoSelectCall
Execute a non selecting call.- Returns:
- the row count.
- Throws:
DatabaseException
- - an error has occurred on the database.
-
executeSelect
INTERNAL: Execute a selecting call.- Specified by:
executeSelect
in classDatabaseQueryMechanism
- Throws:
DatabaseException
- - an error has occurred on the database
-
executeSelectCall
INTERNAL: Execute a selecting call.- Throws:
DatabaseException
- - an error has occurred on the database
-
getCall
Return the call. -
getCalls
Normally only a single call is used, however multiple table may require multiple calls on write. This is lazy initialised to conserve space. -
hasMultipleCalls
public boolean hasMultipleCalls()Normally only a single call is used, however multiple table may require multiple calls on write. This is lazy initialised to conserve space. -
insertObject
Insert the object. Assume the call is correct.- Specified by:
insertObject
in classDatabaseQueryMechanism
- Throws:
DatabaseException
- - an error has occurred on the database
-
executeDeferredCall
Execute the call that was deferred to the commit manager. This is used to allow multiple table batching and deadlock avoidance.- Overrides:
executeDeferredCall
in classDatabaseQueryMechanism
-
isCallQueryMechanism
public boolean isCallQueryMechanism()Return true if this is a call query mechanism- Overrides:
isCallQueryMechanism
in classDatabaseQueryMechanism
-
prepare
public 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. This query is copied for concurrency so this prepare can only setup things that will apply to any future execution of this query.- Overrides:
prepare
in classDatabaseQueryMechanism
-
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. This query is copied for concurrency so this prepare can only setup things that will apply to any future execution of this query.- Throws:
QueryException
-
prepareCursorSelectAllRows
Pre-build configure the call.- Specified by:
prepareCursorSelectAllRows
in classDatabaseQueryMechanism
- Throws:
QueryException
-
prepareDeleteAll
public void prepareDeleteAll()Pre-build configure the call.- Specified by:
prepareDeleteAll
in classDatabaseQueryMechanism
-
prepareDeleteObject
public void prepareDeleteObject()Pre-build configure the call.- Specified by:
prepareDeleteObject
in classDatabaseQueryMechanism
-
prepareDoesExist
Pre-build configure the call.- Specified by:
prepareDoesExist
in classDatabaseQueryMechanism
-
prepareExecuteNoSelect
public void prepareExecuteNoSelect()Pre-build configure the call.- Specified by:
prepareExecuteNoSelect
in classDatabaseQueryMechanism
-
prepareExecute
public void prepareExecute()Pre-build configure the call. This method assumes the query was built using a stored procedure query which is a single call. The return type on the call will already be set and- Specified by:
prepareExecute
in classDatabaseQueryMechanism
-
prepareExecuteSelect
public void prepareExecuteSelect()Pre-build configure the call.- Specified by:
prepareExecuteSelect
in classDatabaseQueryMechanism
-
prepareInsertObject
public void prepareInsertObject()Pre-build configure the call.- Specified by:
prepareInsertObject
in classDatabaseQueryMechanism
-
prepareReportQueryItems
protected void prepareReportQueryItems()Prepare the report items. Indexes of results need to be calculated. -
computeAndSetItemOffset
calculate indexes for given items, given the current Offset -
prepareReportQuerySelectAllRows
public void prepareReportQuerySelectAllRows()Pre-build configure the call.- Specified by:
prepareReportQuerySelectAllRows
in classDatabaseQueryMechanism
-
prepareReportQuerySubSelect
public void prepareReportQuerySubSelect()Prepare for a sub select using a call.- Specified by:
prepareReportQuerySubSelect
in classDatabaseQueryMechanism
-
prepareSelectAllRows
public void prepareSelectAllRows()Pre-build configure the call.- Specified by:
prepareSelectAllRows
in classDatabaseQueryMechanism
-
prepareSelectOneRow
public void prepareSelectOneRow()Pre-build configure the call.- Specified by:
prepareSelectOneRow
in classDatabaseQueryMechanism
-
prepareUpdateObject
public void prepareUpdateObject()Pre-build configure the call.- Specified by:
prepareUpdateObject
in classDatabaseQueryMechanism
-
prepareUpdateAll
public void prepareUpdateAll()Pre-build configure the call.- Specified by:
prepareUpdateAll
in classDatabaseQueryMechanism
-
selectAllReportQueryRows
Read all rows from the database. Assume call is correct returns the required fields.- Specified by:
selectAllReportQueryRows
in classDatabaseQueryMechanism
- Returns:
- Vector containing the database rows
- Throws:
DatabaseException
- - an error has occurred on the database
-
selectAllRows
Read all rows from the database. Assume call is correct returns the required fields.- Specified by:
selectAllRows
in classDatabaseQueryMechanism
- Returns:
- Vector containing the database rows
- Throws:
DatabaseException
- - an error has occurred on the database
-
selectOneRow
Read a single row from the database. Assume call is correct.- Specified by:
selectOneRow
in classDatabaseQueryMechanism
- Returns:
- row containing data
- Throws:
DatabaseException
- - an error has occurred on the database
-
selectRowForDoesExist
Perform a does exist check- Specified by:
selectRowForDoesExist
in classDatabaseQueryMechanism
- Parameters:
field
- - the field used for does exist check- Returns:
- the associated row from the database
- Throws:
DatabaseException
- - an error has occurred on the database
-
setCall
Set the call. -
setCalls
Normally only a single call is used, however multiple table may require multiple calls on write. This is lazy initialised to conserve space. -
updateObject
Update the object. Assume the call is correct.- Specified by:
updateObject
in classDatabaseQueryMechanism
- Returns:
- the row count.
- Throws:
DatabaseException
- - an error has occurred on the database.
-
updateAll
Update the rows on the database. Assume the call is correct.- Specified by:
updateAll
in classDatabaseQueryMechanism
- Throws:
DatabaseException
- - an error has occurred on the database.
-
updateAllUsingTempTables
Execute updateAll using temp tables- Returns:
- the row count.
- Throws:
DatabaseException
- - an error has occurred on the database.
-
updateForeignKeyFieldAfterInsert
Update the foreign key fields when resolving a bi-directional reference in a UOW. This is rare to occur for non-relational, however if it does each of the calls must be re-executed.- Specified by:
updateForeignKeyFieldAfterInsert
in classDatabaseQueryMechanism
-