Oracle Application Server TopLink API Reference
10g (9.0.4)

B10491-01

oracle.toplink.sdk
Class SDKQueryMechanism

java.lang.Object
  |
  +--oracle.toplink.internal.queryframework.DatabaseQueryMechanism
        |
        +--oracle.toplink.sdk.SDKQueryMechanism
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class SDKQueryMechanism
extends oracle.toplink.internal.queryframework.DatabaseQueryMechanism

The SDKQueryMechanism class implements the DatabaseQueryMechanism protocol by redirecting all queries to a collection of calls that is provided to the mechanism when it is built. So just about everything ends up going through executeSelectCalls() or executeNoSelectCalls(), which, in turn, send the appropriate message to the SDKAccessor.

Since:
TOPLink/Java 1.0
See Also:
SDKAccessor, SDKCall, AbstractSDKCall, Serialized Form

Constructor Summary
SDKQueryMechanism(DatabaseQuery query)
          Construct a new mechanism for the specified query.
SDKQueryMechanism(DatabaseQuery query, SDKCall call)
          Construct a new mechanism for the specified query and call.

 

Method Summary
 void addCall(SDKCall call)
          Add a call.
 oracle.toplink.internal.databaseaccess.DatabaseCall cursorSelectAllRows()
           
 void deleteAll()
          Delete a collection of objects.
 java.lang.Integer deleteObject()
          Delete an object.
 java.lang.Integer executeNoSelect()
          Execute a raw (non-object), non-selecting database call.
 java.util.Vector executeSelect()
          Execute a raw (non-object) database call that returns a result.
 java.util.Vector getCalls()
          Return the mechanism's calls.
 void insertObject()
          Insert an object.
 boolean isCallQueryMechanism()
          Return true if this is a call query mechanism.
 void prepare()
          This is different from 'prepareForExecution()' in that this is called on the original query, and the other is called on the clone of the query.
 void prepareCursorSelectAllRows()
           
 void prepareDeleteAll()
          Prepare for a delete all.
 void prepareDeleteObject()
          Prepare for a delete.
 void prepareDoesExist(oracle.toplink.internal.helper.DatabaseField field)
           
 void prepareExecuteNoSelect()
          Prepare for a raw (non-object), non-selecting call.
 void prepareExecuteSelect()
          Prepare for a raw (non-object) select call.
 void prepareForExecution()
          All the query mechanism-related things are initialized here.
 void prepareInsertObject()
          Prepare for an insert.
 void prepareReportQuerySelectAllRows()
           
 void prepareReportQuerySubSelect()
           
 void prepareSelectAllReportRows()
          Prepare for a report query.
 void prepareSelectAllRows()
          Prepare for a select returning (possibly) multiple rows.
 void prepareSelectOneRow()
          Prepare for a select returning a single row.
 void prepareSelectRowForDoesExist(oracle.toplink.internal.helper.DatabaseField field)
          Prepare for an existence check.
 void prepareStartCursor()
          Prepare for a cursored select.
 void prepareUpdateObject()
          Prepare for an update.
 java.util.Vector selectAllReportQueryRows()
           
 java.util.Vector selectAllReportRows()
          Read and return rows from the database for a report query.
 java.util.Vector selectAllRows()
          Read and return rows from the database.
 DatabaseRow selectOneRow()
          Read and return a row from the database.
 DatabaseRow selectRowForDoesExist(oracle.toplink.internal.helper.DatabaseField field)
          Read and return a row from the database for an existence check.
 oracle.toplink.internal.databaseaccess.DatabaseCall startCursor()
          Start reading all the rows from the database for a cursored stream or scrollable cursor.
 java.lang.String toString()
           
 java.lang.Integer updateObject()
          Update an object.

 

Methods inherited from class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
buildObjectsFromRows, buildSelectionCriteria, checkCacheForObject, clone, executeWrite, executeWriteWithChangeSet, getModifyRow, getQuery, getSelectionCriteria, insertObject, insertObjectForWrite, insertObjectForWriteWithChangeSet, isEJBQLCallQueryMechanism, isExpressionQueryMechanism, isStatementQueryMechanism, setQuery, updateObjectForWrite, updateObjectForWriteWithChangeSet

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

SDKQueryMechanism

public SDKQueryMechanism(DatabaseQuery query)
Construct a new mechanism for the specified query.

SDKQueryMechanism

public SDKQueryMechanism(DatabaseQuery query,
SDKCall call)
Construct a new mechanism for the specified query and call.
Method Detail

addCall

public void addCall(SDKCall call)
Add a call.

cursorSelectAllRows

public oracle.toplink.internal.databaseaccess.DatabaseCall cursorSelectAllRows()
                                                                        throws SDKDataStoreException
Specified by:
cursorSelectAllRows in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
SDKDataStoreException

deleteAll

public void deleteAll()
               throws SDKDataStoreException
Delete a collection of objects.

Assume the calls are correct.

Specified by:
deleteAll in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

deleteObject

public java.lang.Integer deleteObject()
                               throws SDKDataStoreException
Delete an object.

Assume the calls are correct.

Specified by:
deleteObject in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the number of rows deleted
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

executeNoSelect

public java.lang.Integer executeNoSelect()
                                  throws SDKDataStoreException
Execute a raw (non-object), non-selecting database call.

Assume the calls are correct.

Specified by:
executeNoSelect in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the number of rows affected
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

executeSelect

public java.util.Vector executeSelect()
                               throws SDKDataStoreException
Execute a raw (non-object) database call that returns a result.

Assume the calls are correct.

Specified by:
executeSelect in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the collection of rows
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

getCalls

public java.util.Vector getCalls()
Return the mechanism's calls.

insertObject

public void insertObject()
                  throws SDKDataStoreException
Insert an object.

Assume the calls are correct.

Specified by:
insertObject in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

isCallQueryMechanism

public boolean isCallQueryMechanism()
Return true if this is a call query mechanism.
Overrides:
isCallQueryMechanism in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism

prepare

public void prepare()
             throws SDKQueryException
This is different from 'prepareForExecution()' in that this is called on the original query, and the other is called on the clone 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 class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareCursorSelectAllRows

public void prepareCursorSelectAllRows()
                                throws SDKQueryException
Specified by:
prepareCursorSelectAllRows in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
SDKQueryException

prepareDeleteAll

public void prepareDeleteAll()
                      throws SDKQueryException
Prepare for a delete all. This is sent to the original query before cloning.
Specified by:
prepareDeleteAll in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareDeleteObject

public void prepareDeleteObject()
                         throws SDKQueryException
Prepare for a delete. This is sent to the original query before cloning.
Specified by:
prepareDeleteObject in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareDoesExist

public void prepareDoesExist(oracle.toplink.internal.helper.DatabaseField field)
                      throws SDKQueryException
Specified by:
prepareDoesExist in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
SDKQueryException

prepareExecuteNoSelect

public void prepareExecuteNoSelect()
                            throws SDKQueryException
Prepare for a raw (non-object), non-selecting call. This is sent to the original query before cloning.
Specified by:
prepareExecuteNoSelect in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareExecuteSelect

public void prepareExecuteSelect()
                          throws SDKQueryException
Prepare for a raw (non-object) select call. This is sent to the original query before cloning.
Specified by:
prepareExecuteSelect in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareForExecution

public void prepareForExecution()
                         throws SDKQueryException
All the query mechanism-related things are initialized here.
Overrides:
prepareForExecution in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareInsertObject

public void prepareInsertObject()
                         throws SDKQueryException
Prepare for an insert. This is sent to the original query before cloning.
Specified by:
prepareInsertObject in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareReportQuerySelectAllRows

public void prepareReportQuerySelectAllRows()
                                     throws SDKQueryException
Specified by:
prepareReportQuerySelectAllRows in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
SDKQueryException

prepareReportQuerySubSelect

public void prepareReportQuerySubSelect()
                                 throws SDKQueryException
Specified by:
prepareReportQuerySubSelect in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
SDKQueryException

prepareSelectAllReportRows

public void prepareSelectAllReportRows()
                                throws SDKQueryException
Prepare for a report query. This is sent to the original query before cloning.
Throws:
SDKQueryException - if something is amiss

prepareSelectAllRows

public void prepareSelectAllRows()
                          throws SDKQueryException
Prepare for a select returning (possibly) multiple rows. This is sent to the original query before cloning.
Specified by:
prepareSelectAllRows in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareSelectOneRow

public void prepareSelectOneRow()
                         throws SDKQueryException
Prepare for a select returning a single row. This is sent to the original query before cloning.
Specified by:
prepareSelectOneRow in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

prepareSelectRowForDoesExist

public void prepareSelectRowForDoesExist(oracle.toplink.internal.helper.DatabaseField field)
                                  throws SDKQueryException
Prepare for an existence check. This is sent to the original query before cloning.
Throws:
SDKQueryException - if something is amiss

prepareStartCursor

public void prepareStartCursor()
                        throws SDKQueryException
Prepare for a cursored select. This is sent to the original query before cloning.
Throws:
SDKQueryException - if something is amiss

prepareUpdateObject

public void prepareUpdateObject()
                         throws SDKQueryException
Prepare for an update. This is sent to the original query before cloning.
Specified by:
prepareUpdateObject in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Throws:
SDKQueryException - if something is amiss

selectAllReportQueryRows

public java.util.Vector selectAllReportQueryRows()
                                          throws SDKDataStoreException
Specified by:
selectAllReportQueryRows in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
SDKDataStoreException

selectAllReportRows

public java.util.Vector selectAllReportRows()
                                     throws SDKDataStoreException
Read and return rows from the database for a report query.

Assume the calls are correct.

Returns:
the collection of rows
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

selectAllRows

public java.util.Vector selectAllRows()
                               throws SDKDataStoreException
Read and return rows from the database.

Assume the calls are correct.

Specified by:
selectAllRows in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the collection of rows
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

selectOneRow

public DatabaseRow selectOneRow()
                                                        throws SDKDataStoreException
Read and return a row from the database.

Assume the calls are correct.

Specified by:
selectOneRow in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the row
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

selectRowForDoesExist

public DatabaseRow selectRowForDoesExist(oracle.toplink.internal.helper.DatabaseField field)
                                                                 throws SDKDataStoreException
Read and return a row from the database for an existence check.

Assume the calls are correct.

Specified by:
selectRowForDoesExist in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the row
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

startCursor

public oracle.toplink.internal.databaseaccess.DatabaseCall startCursor()
                                                                throws SDKDataStoreException
Start reading all the rows from the database for a cursored stream or scrollable cursor. Return the DatabaseCall - the CursorPolicy will perform the actual reading of the rows from the database.

Assume the calls are correct.

Cursors are not currently supported.

Returns:
the call
Throws:
SDKDataStoreException - if an error has occurred on the "data store"

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

updateObject

public java.lang.Integer updateObject()
                               throws SDKDataStoreException
Update an object.

Assume the calls are correct.

Specified by:
updateObject in class oracle.toplink.internal.queryframework.DatabaseQueryMechanism
Returns:
the number of rows affected by the update
Throws:
SDKDataStoreException - if an error has occurred on the "data store

Copyright © 2003 Oracle Corporation. All Rights Reserved.