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 DatasourceCallprotected VectorNormally 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 TypeMethodDescriptionvoidaddCall(DatasourceCall call) Add the call.clone(DatabaseQuery queryClone) Clone the DatasourceCall andVector<DatasourceCall>.protected intcomputeAndSetItemOffset(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 ObjectExecute the call.protected ObjectexecuteCall(DatasourceCall databaseCall) Execute the call.voidExecute 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.booleanNormally only a single call is used, however multiple table may require multiple calls on write.voidInsert the object.booleanReturn true if this is a call query mechanismvoidprepare()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.voidINTERNAL: 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.voidPre-build configure the call.voidPre-build configure the call.voidPre-build configure the call.voidprepareDoesExist(DatabaseField field) Pre-build configure the call.voidPre-build configure the call.voidPre-build configure the call.voidPre-build configure the call.voidPre-build configure the call.protected voidPrepare the report items.voidPre-build configure the call.voidPrepare for a sub select using a call.voidPre-build configure the call.voidPre-build configure the call.voidPre-build configure the call.voidPre-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 checkvoidsetCall(DatasourceCall call) Set the call.protected voidNormally 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 voidupdateForeignKeyFieldAfterInsert(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:
clonein classDatabaseQueryMechanism
-
cursorSelectAllRows
Read all rows from the database using a cursored stream.- Specified by:
cursorSelectAllRowsin 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:
deleteAllin 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:
deleteObjectin classDatabaseQueryMechanism- Returns:
- the row count.
- Throws:
DatabaseException- - an error has occurred on the database
-
execute
INTERNAL: Execute a call.- Specified by:
executein 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:
executeNoSelectin classDatabaseQueryMechanism- Returns:
- Returns either a
DatabaseCallor 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:
generateKeysExecuteNoSelectin 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:
executeSelectin 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:
insertObjectin 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:
executeDeferredCallin classDatabaseQueryMechanism
-
isCallQueryMechanism
public boolean isCallQueryMechanism()Return true if this is a call query mechanism- Overrides:
isCallQueryMechanismin 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:
preparein 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:
prepareCursorSelectAllRowsin classDatabaseQueryMechanism- Throws:
QueryException
-
prepareDeleteAll
public void prepareDeleteAll()Pre-build configure the call.- Specified by:
prepareDeleteAllin classDatabaseQueryMechanism
-
prepareDeleteObject
public void prepareDeleteObject()Pre-build configure the call.- Specified by:
prepareDeleteObjectin classDatabaseQueryMechanism
-
prepareDoesExist
Pre-build configure the call.- Specified by:
prepareDoesExistin classDatabaseQueryMechanism
-
prepareExecuteNoSelect
public void prepareExecuteNoSelect()Pre-build configure the call.- Specified by:
prepareExecuteNoSelectin 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:
prepareExecutein classDatabaseQueryMechanism
-
prepareExecuteSelect
public void prepareExecuteSelect()Pre-build configure the call.- Specified by:
prepareExecuteSelectin classDatabaseQueryMechanism
-
prepareInsertObject
public void prepareInsertObject()Pre-build configure the call.- Specified by:
prepareInsertObjectin 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:
prepareReportQuerySelectAllRowsin classDatabaseQueryMechanism
-
prepareReportQuerySubSelect
public void prepareReportQuerySubSelect()Prepare for a sub select using a call.- Specified by:
prepareReportQuerySubSelectin classDatabaseQueryMechanism
-
prepareSelectAllRows
public void prepareSelectAllRows()Pre-build configure the call.- Specified by:
prepareSelectAllRowsin classDatabaseQueryMechanism
-
prepareSelectOneRow
public void prepareSelectOneRow()Pre-build configure the call.- Specified by:
prepareSelectOneRowin classDatabaseQueryMechanism
-
prepareUpdateObject
public void prepareUpdateObject()Pre-build configure the call.- Specified by:
prepareUpdateObjectin classDatabaseQueryMechanism
-
prepareUpdateAll
public void prepareUpdateAll()Pre-build configure the call.- Specified by:
prepareUpdateAllin classDatabaseQueryMechanism
-
selectAllReportQueryRows
Read all rows from the database. Assume call is correct returns the required fields.- Specified by:
selectAllReportQueryRowsin 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:
selectAllRowsin 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:
selectOneRowin classDatabaseQueryMechanism- Returns:
- row containing data
- Throws:
DatabaseException- - an error has occurred on the database
-
selectRowForDoesExist
Perform a does exist check- Specified by:
selectRowForDoesExistin 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:
updateObjectin 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:
updateAllin 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:
updateForeignKeyFieldAfterInsertin classDatabaseQueryMechanism
-