|
Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated) 11g Release 1 (11.1.1) B32476-04 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.toplink.queryframework.DatabaseQuery oracle.toplink.queryframework.ReadQuery oracle.toplink.queryframework.ObjectBuildingQuery
public abstract class ObjectBuildingQuery
Purpose: Abstract class for all read queries that build objects and potentially manipulate the TopLink cache.
Description: Contains common behavior for all read queries building objects.
Field Summary | |
---|---|
static short |
DEFAULT_LOCK_MODE
|
static short |
LOCK
|
static short |
LOCK_NOWAIT
|
static short |
NO_LOCK
|
Fields inherited from class oracle.toplink.queryframework.DatabaseQuery |
---|
CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading |
Method Summary | |
---|---|
void |
dontRefreshIdentityMapResult()
When unset means perform read normally and dont do refresh. |
void |
dontRefreshRemoteIdentityMapResult()
When unset means perform read normally and dont do refresh. |
FetchGroup |
getFetchGroup()
Return the fetch group set in the query. |
short |
getLockMode()
Return the current locking mode. |
java.lang.Class |
getReferenceClass()
Return the reference class of the query. |
boolean |
isLockQuery()
Answers if the query lock mode is known to be LOCK or LOCK_NOWAIT. |
boolean |
isObjectBuildingQuery()
Return if this is an object building query. |
void |
refreshIdentityMapResult()
Refresh the attributes of the object(s) resulting from the query. |
void |
refreshRemoteIdentityMapResult()
Refresh the attributes of the object(s) resulting from the query. |
void |
setLockMode(short lockMode)
Sets whether this is a pessimistically locking query. |
void |
setReferenceClass(java.lang.Class aClass)
REQUIRED: Set the reference class for the query. |
void |
setShouldProcessResultsInUnitOfWork(boolean processResultsInUnitOfWork)
ADVANCED: Used for CMP only. |
void |
setShouldRefreshIdentityMapResult(boolean shouldRefreshIdentityMapResult)
Set if the attributes of the object(s) resulting from the query should be refreshed. |
void |
setShouldRefreshRemoteIdentityMapResult(boolean shouldRefreshIdentityMapResult)
Set if the attributes of the object(s) resulting from the query should be refreshed. |
void |
setShouldUseExclusiveConnection(boolean shouldUseExclusiveConnection)
ADVANCED: If the user has isolated data and specified that the client session should use an exclusive connection then by setting this condition to true TopLink will ensure that the query is executed through the exclusive connection. |
boolean |
shouldProcessResultsInUnitOfWork()
ADVANCED: Used for CMP only. |
boolean |
shouldRefreshIdentityMapResult()
Set to a boolean. |
boolean |
shouldRefreshRemoteIdentityMapResult()
Set to a boolean. |
boolean |
shouldUseExclusiveConnection()
ADVANCED: If the user has isolated data and specified that the client session should use an exclusive connection then by setting this condition to true TopLink will ensure that the query is executed through the exclusive connection. |
java.lang.String |
toString()
|
Methods inherited from class oracle.toplink.queryframework.ReadQuery |
---|
cacheQueryResults, clearQueryResults, clearQueryResults, doNotCacheQueryResults, getFetchSize, getFirstResult, getMaxRows, getQueryResultsCachePolicy, isReadQuery, setFetchSize, setFirstResult, setMaxRows, setQueryResultsCachePolicy, setShouldCacheQueryResults, shouldCacheQueryResults |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final short NO_LOCK
public static final short LOCK
public static final short LOCK_NOWAIT
public static final short DEFAULT_LOCK_MODE
Method Detail |
---|
public void dontRefreshIdentityMapResult()
public void dontRefreshRemoteIdentityMapResult()
public FetchGroup getFetchGroup()
public short getLockMode()
public java.lang.Class getReferenceClass()
getReferenceClass
in class DatabaseQuery
public boolean isLockQuery()
If a single joined attribute was configured for pessimistic locking then this will return true (after first execution) as the SQL contained a FOR UPDATE OF clause.
public boolean isObjectBuildingQuery()
isObjectBuildingQuery
in class DatabaseQuery
public void refreshIdentityMapResult()
public void refreshRemoteIdentityMapResult()
public void setLockMode(short lockMode)
Fine Grained Locking: On execution the reference class and those of all joined attributes will be checked. If any of these have a PessimisticLockingPolicy set on their descriptor, they will be locked in a SELECT ... FOR UPDATE OF ... {NO WAIT}. Issues fewer locks and avoids setting the lock mode on each query.
Example:readAllQuery.setSelectionCriteria(employee.get("address").equal("Ottawa"));
PessimisticLockingPolicy
public void setReferenceClass(java.lang.Class aClass)
public void setShouldRefreshIdentityMapResult(boolean shouldRefreshIdentityMapResult)
public void setShouldRefreshRemoteIdentityMapResult(boolean shouldRefreshIdentityMapResult)
public void setShouldUseExclusiveConnection(boolean shouldUseExclusiveConnection)
public boolean shouldUseExclusiveConnection()
public boolean shouldRefreshIdentityMapResult()
public boolean shouldRefreshRemoteIdentityMapResult()
public java.lang.String toString()
toString
in class DatabaseQuery
public void setShouldProcessResultsInUnitOfWork(boolean processResultsInUnitOfWork)
If set to false, then UnitOfWork allocation will be deferred until a business method (including creates/removes) or finder with shouldProcessResultsInUnitOfWork == true is invoked. Any finder executed before such a time, will do so against the underlying ServerSession. Forcing finder execution to always go through a UnitOfWork means the results will be cloned and cached in the UnitOfWork up front. This is desired when the results will be accessed in the same transaction.
Note that finders executed with an unspecified transaction context will never be executed against a UnitOfWork, even if this setting is true. This case may happen with the NotSupported, Never, and Supports attributes.
public boolean shouldProcessResultsInUnitOfWork()
If set to false, then UnitOfWork allocation will be deferred until a business method (including creates/removes) or finder with shouldProcessResultsInUnitOfWork == true is invoked. Any finder executed before such a time, will do so against the underlying ServerSession. Forcing finder execution to always go through a UnitOfWork means the results will be cloned and cached in the UnitOfWork up front. This is desired when the results will be accessed in the same transaction.
Note that finders executed with an unspecified transaction context will never be executed against a UnitOfWork, even if this setting is true. This case may happen with the NotSupported, Never, and Supports attributes.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |