Top Description Fields Constructors Methods
org.eclipse.persistence.internal.queries

public Class DatasourceCallQueryMechanism

extends DatabaseQueryMechanism
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.queries.CallQueryMechanism
Imports
java.util.Collection, .Enumeration, .List, .Vector, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.DatabaseException, .QueryException, org.eclipse.persistence.internal.databaseaccess.Accessor, .DatabaseCall, .DatasourceCall, org.eclipse.persistence.internal.helper.DatabaseField, .DatabaseTable, .Helper, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.mappings.DatabaseMapping.WriteType, org.eclipse.persistence.queries.ConstructorReportItem, .DatabaseQuery, .DeleteAllQuery, .ReportQuery, .UpdateAllQuery, .WriteObjectQuery

Purpose: Mechanism used for call queries.

Responsibilities: Executes the appropriate call.

Author
James Sutherland
Since
OracleAS TopLink 10g (10.0.3)

Field Summary

Modifier and TypeField and Description
protected DatasourceCall
protected Vector<E>
calls

Normally only a single call is used, however multiple table may require multiple calls on write.

Inherited from org.eclipse.persistence.internal.queries.DatabaseQueryMechanism:
query

Constructor Summary

AccessConstructor and Description
public
public
DatasourceCallQueryMechanism(DatabaseQuery
- owner of mechanism
query
)

Initialize the state of the query

public
DatasourceCallQueryMechanism(DatabaseQuery
- owner of mechanism
query
,
DatasourceCall call)

Initialize the state of the query

Method Summary

Modifier and TypeMethod and Description
public void
addCall(DatasourceCall call)

Add the call.

public DatabaseQueryMechanism
clone(DatabaseQuery queryClone)

Overrides org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.clone.

Clone the DatasourceCall and Vector<DatasourceCall>.
protected int
computeAndSetItemOffset(ReportQuery query, List<ReportItem> items, int itemOffset)

calculate indexes for given items, given the current Offset

public DatabaseCall
cursorSelectAllRows()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.cursorSelectAllRows.

Read all rows from the database using a cursored stream.
public Integer
deleteAll()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.deleteAll.

INTERNAL: Delete a collection of objects.
public Integer

Returns:

the row count.
deleteAllUsingTempTables
()

Execute deleteAll using temp tables

public Integer
public Object
protected Object
executeCall()

Execute the call.

protected Object
executeCall(DatasourceCall databaseCall)

Execute the call.

public void
public Object

Returns:

Returns either a DatabaseCall or Integer value, depending on if this INSERT call needs to return generated keys
executeNoSelect
()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeNoSelect.

Execute a non selecting call.
public Integer

Returns:

the row count.
executeNoSelectCall
()

Execute a non selecting call.

public Vector<E>
executeSelect()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeSelect.

INTERNAL: Execute a selecting call.
public Vector<E>
executeSelectCall()

INTERNAL: Execute a selecting call.

public DatabaseCall
public DatasourceCall
getCall()

Return the call.

public Vector<E>
getCalls()

Normally only a single call is used, however multiple table may require multiple calls on write.

public boolean
hasMultipleCalls()

Normally only a single call is used, however multiple table may require multiple calls on write.

public void
public boolean
public void
prepare()

Overrides org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.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.
public 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.

public void
public void
public void
public void
public void
public void
public void
public void
protected void
prepareReportQueryItems()

Prepare the report items.

public void
public void
public void
public void
public void
public void
public Vector<E>

Returns:

Vector containing the database rows
selectAllReportQueryRows
()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectAllReportQueryRows.

Read all rows from the database.
public Vector<E>

Returns:

Vector containing the database rows
selectAllRows
()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectAllRows.

Read all rows from the database.
public AbstractRecord

Returns:

row containing data
selectOneRow
()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectOneRow.

Read a single row from the database.
public DatabaseCall
selectResultSet()

Read all rows from the database, return ResultSet

public AbstractRecord

Returns:

the associated row from the database
selectRowForDoesExist
(DatabaseField
- the field used for does exist check
field
)

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectRowForDoesExist.

Perform a does exist check
public void
setCall(DatasourceCall call)

Set the call.

protected void
setCalls(Vector<E> calls)

Normally only a single call is used, however multiple table may require multiple calls on write.

public Integer
updateAll()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateAll.

Update the rows on the database.
public Integer

Returns:

the row count.
updateAllUsingTempTables
()

Execute updateAll using temp tables

protected void
updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery)

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateForeignKeyFieldAfterInsert.

Update the foreign key fields when resolving a bi-directional reference in a UOW.
public Integer

Returns:

the row count.
updateObject
()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObject.

Update the object.
Inherited from org.eclipse.persistence.internal.queries.DatabaseQueryMechanism:
addWriteLockFieldForInsertbuildSelectionCriteriacheckCacheForObjectcloneexecuteWriteexecuteWriteWithChangeSetgetDescriptorgetExecutionSessiongetModifyRowgetQuerygetReadObjectQuerygetSelectionCriteriagetSessiongetTranslationRowgetWriteObjectQueryinsertObjectinsertObjectForWriteisExpressionQueryMechanismisJPQLCallQueryMechanismisQueryByExampleMechanismisStatementQueryMechanismperformUserDefinedInsertperformUserDefinedUpdateperformUserDefinedWriteregisterObjectInIdentityMapsetQueryshallowInsertObjectForWriteunprepareupdateForeignKeyFieldAfterInsertupdateForeignKeyFieldBeforeDeleteupdateObjectAndRowWithReturnRowupdateObjectAndRowWithSequenceNumberupdateObjectAndRowWithSequenceNumberupdateObjectForWriteupdateObjectForWriteWithChangeSet

Field Detail

callback to summary
protected DatasourceCall call
callsback to summary
protected Vector<E> calls

Normally only a single call is used, however multiple table may require multiple calls on write.

Constructor Detail

DatasourceCallQueryMechanismback to summary
public DatasourceCallQueryMechanism()
DatasourceCallQueryMechanismback to summary
public DatasourceCallQueryMechanism(DatabaseQuery query)

Initialize the state of the query

Parameters
query:DatabaseQuery

- owner of mechanism

DatasourceCallQueryMechanismback to summary
public DatasourceCallQueryMechanism(DatabaseQuery query, DatasourceCall call)

Initialize the state of the query

Parameters
query:DatabaseQuery

- owner of mechanism

Method Detail

addCallback to summary
public void addCall(DatasourceCall call)

Add the call.

cloneback to summary
public DatabaseQueryMechanism clone(DatabaseQuery queryClone)

Overrides org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.clone.

Clone the DatasourceCall and Vector<DatasourceCall>.

Annotations
@Override
computeAndSetItemOffsetback to summary
protected int computeAndSetItemOffset(ReportQuery query, List<ReportItem> items, int itemOffset)

calculate indexes for given items, given the current Offset

cursorSelectAllRowsback to summary
public DatabaseCall cursorSelectAllRows() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.cursorSelectAllRows.

Read all rows from the database using a cursored stream.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
deleteAllback to summary
public Integer deleteAll() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.deleteAll.

INTERNAL: Delete a collection of objects. Assume call is correct.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
deleteAllUsingTempTablesback to summary
public Integer deleteAllUsingTempTables() throws DatabaseException

Execute deleteAll using temp tables

Returns:Integer

the row count.

Exceptions
DatabaseException:
- an error has occurred on the database.
deleteObjectback to summary
public Integer deleteObject() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.deleteObject.

INTERNAL: Delete an object. Assume call is correct

Returns:Integer

Doc from org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.deleteObject.

the row count.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
executeback to summary
public Object execute() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.execute.

INTERNAL: Execute a call.

Returns:Object

Doc from org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.execute.

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.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
executeCallback to summary
protected Object executeCall() throws DatabaseException

Execute the call. It is assumed the call has been fully prepared.

Exceptions
DatabaseException:
- an error has occurred on the database.
executeCallback to summary
protected Object executeCall(DatasourceCall databaseCall) throws DatabaseException

Execute the call. It is assumed the call has been fully prepared.

Exceptions
DatabaseException:
- an error has occurred on the database.
executeDeferredCallback to summary
public void executeDeferredCall(DatasourceCall call)

Overrides org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeDeferredCall.

Execute the call that was deferred to the commit manager. This is used to allow multiple table batching and deadlock avoidance.

Annotations
@Override
executeNoSelectback to summary
public Object executeNoSelect() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeNoSelect.

Execute a non selecting call.

Returns:Object

Returns either a DatabaseCall or Integer value, depending on if this INSERT call needs to return generated keys

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database.
executeNoSelectCallback to summary
public Integer executeNoSelectCall() throws DatabaseException

Execute a non selecting call.

Returns:Integer

the row count.

Exceptions
DatabaseException:
- an error has occurred on the database.
executeSelectback to summary
public Vector<E> executeSelect() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.executeSelect.

INTERNAL: Execute a selecting call.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
executeSelectCallback to summary
public Vector<E> executeSelectCall() throws DatabaseException

INTERNAL: Execute a selecting call.

Exceptions
DatabaseException:
- an error has occurred on the database
generateKeysExecuteNoSelectback to summary
public DatabaseCall generateKeysExecuteNoSelect() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.generateKeysExecuteNoSelect.

Execute a non selecting call.

Returns:DatabaseCall

the row count.

Exceptions
DatabaseException:
- an error has occurred on the database.
getCallback to summary
public DatasourceCall getCall()

Return the call.

getCallsback to summary
public Vector<E> getCalls()

Normally only a single call is used, however multiple table may require multiple calls on write. This is lazy initialised to conserve space.

hasMultipleCallsback to summary
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.

insertObjectback to summary
public void insertObject() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.insertObject.

Insert the object. Assume the call is correct.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
isCallQueryMechanismback to summary
public boolean isCallQueryMechanism()

Overrides org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.isCallQueryMechanism.

Return true if this is a call query mechanism

Annotations
@Override
prepareback to summary
public void prepare()

Overrides org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.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.

Annotations
@Override
prepareCallback to summary
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.

prepareCursorSelectAllRowsback to summary
public void prepareCursorSelectAllRows() throws QueryException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareCursorSelectAllRows.

Pre-build configure the call.

Annotations
@Override
prepareDeleteAllback to summary
public void prepareDeleteAll()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareDeleteAll.

Pre-build configure the call.

Annotations
@Override
prepareDeleteObjectback to summary
public void prepareDeleteObject()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareDeleteObject.

Pre-build configure the call.

Annotations
@Override
prepareDoesExistback to summary
public void prepareDoesExist(DatabaseField field)

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareDoesExist.

Pre-build configure the call.

Annotations
@Override
prepareExecuteback to summary
public void prepareExecute()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.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

Annotations
@Override
prepareExecuteNoSelectback to summary
public void prepareExecuteNoSelect()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareExecuteNoSelect.

Pre-build configure the call.

Annotations
@Override
prepareExecuteSelectback to summary
public void prepareExecuteSelect()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareExecuteSelect.

Pre-build configure the call.

Annotations
@Override
prepareInsertObjectback to summary
public void prepareInsertObject()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareInsertObject.

Pre-build configure the call.

Annotations
@Override
prepareReportQueryItemsback to summary
protected void prepareReportQueryItems()

Prepare the report items. Indexes of results need to be calculated.

prepareReportQuerySelectAllRowsback to summary
public void prepareReportQuerySelectAllRows()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareReportQuerySelectAllRows.

Pre-build configure the call.

Annotations
@Override
prepareReportQuerySubSelectback to summary
public void prepareReportQuerySubSelect()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareReportQuerySubSelect.

Prepare for a sub select using a call.

Annotations
@Override
prepareSelectAllRowsback to summary
public void prepareSelectAllRows()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareSelectAllRows.

Pre-build configure the call.

Annotations
@Override
prepareSelectOneRowback to summary
public void prepareSelectOneRow()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareSelectOneRow.

Pre-build configure the call.

Annotations
@Override
prepareUpdateAllback to summary
public void prepareUpdateAll()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareUpdateAll.

Pre-build configure the call.

Annotations
@Override
prepareUpdateObjectback to summary
public void prepareUpdateObject()

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.prepareUpdateObject.

Pre-build configure the call.

Annotations
@Override
selectAllReportQueryRowsback to summary
public Vector<E> selectAllReportQueryRows() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectAllReportQueryRows.

Read all rows from the database. Assume call is correct returns the required fields.

Returns:Vector<E>

Vector containing the database rows

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
selectAllRowsback to summary
public Vector<E> selectAllRows() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectAllRows.

Read all rows from the database. Assume call is correct returns the required fields.

Returns:Vector<E>

Vector containing the database rows

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
selectOneRowback to summary
public AbstractRecord selectOneRow() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectOneRow.

Read a single row from the database. Assume call is correct.

Returns:AbstractRecord

row containing data

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
selectResultSetback to summary
public DatabaseCall selectResultSet() throws DatabaseException

Read all rows from the database, return ResultSet

Exceptions
DatabaseException:
- an error has occurred on the database
selectRowForDoesExistback to summary
public AbstractRecord selectRowForDoesExist(DatabaseField field) throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.selectRowForDoesExist.

Perform a does exist check

Parameters
field:DatabaseField

- the field used for does exist check

Returns:AbstractRecord

the associated row from the database

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database
setCallback to summary
public void setCall(DatasourceCall call)

Set the call.

setCallsback to summary
protected void setCalls(Vector<E> calls)

Normally only a single call is used, however multiple table may require multiple calls on write. This is lazy initialised to conserve space.

updateAllback to summary
public Integer updateAll() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateAll.

Update the rows on the database. Assume the call is correct.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database.
updateAllUsingTempTablesback to summary
public Integer updateAllUsingTempTables() throws DatabaseException

Execute updateAll using temp tables

Returns:Integer

the row count.

Exceptions
DatabaseException:
- an error has occurred on the database.
updateForeignKeyFieldAfterInsertback to summary
protected void updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery)

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.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.

Annotations
@Override
updateObjectback to summary
public Integer updateObject() throws DatabaseException

Implements abstract org.eclipse.persistence.internal.queries.DatabaseQueryMechanism.updateObject.

Update the object. Assume the call is correct.

Returns:Integer

the row count.

Annotations
@Override
Exceptions
DatabaseException:
- an error has occurred on the database.