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

public abstract Class ObjectBuildingQuery

extends ReadQuery
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.queries.ResultSetMappingQuery, org.eclipse.persistence.queries.ObjectLevelReadQuery
Imports
java.security.AccessController, .PrivilegedActionException, java.util.List, .Map, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.expressions.Expression, org.eclipse.persistence.internal.expressions.ForUpdateClause, .QueryKeyExpression, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.queries.ContainerPolicy, .JoinedAttributeManager, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedClassForName, org.eclipse.persistence.internal.sessions.AbstractSession, .MergeManager, .UnitOfWorkImpl, org.eclipse.persistence.mappings.DatabaseMapping

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.

Author
Gordon Yorke
Since
TopLink Essentials

Field Summary

Modifier and TypeField and Description
public static final short
protected long
executionTime

Used to set the read time on objects that use this query.

protected boolean
isCacheCheckComplete

was a check early return completed

public static final short
public static final short
public static final String
LOCK_RESULT_PROPERTY

INTERNAL: This is the key for accessing unregistered and locked result in the query's properties.

protected ForUpdateClause
lockingClause

Used for pessimistic locking.

public static final short
protected Map<Object, CacheKey>
protected Boolean
printInnerJoinInWhereClause

Indicates whether the query printer/normalizer changes the way that inner joins are printed in generated SQL for the database.

protected Class<?>
referenceClass

The class of the target objects to be read from the database.

protected String
protected Boolean
requiresDeferredLocks

When reading across relationships, queries may be set to acquire deferred locks This is used to ensure any Eagerly fetched object that is the target of a relationship with an object the acquires deferred locks behaves the same as its owner

protected boolean
shouldBuildNullForNullPk

INTERNAL: If primary key is null ObjectBuilder.buildObject returns null in case this flag is set to true (instead of throwing exception).

protected boolean
shouldRefreshIdentityMapResult

Allows for the resulting objects to be refresh with the data from the database.

protected boolean
protected boolean
shouldRegisterResultsInUnitOfWork

INTERNAL: for bug 2612601 allow ability not to register results in UOW.

protected boolean
shouldUseExclusiveConnection

Added for Exclusive Connection (VPD) support see accessor for information

protected boolean
wasDefaultLockMode

PERF: Store if the query originally used the default lock mode.

Inherited from org.eclipse.persistence.queries.ReadQuery:
allowQueryResultsCacheValidationfetchSizefirstResultmaxResultsmaxRowsqueryIdqueryResultCachingPolicytemporaryCachedQueryResults

Constructor Summary

AccessConstructor and Description
protected
ObjectBuildingQuery()

INTERNAL: Initialize the state of the query

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides org.eclipse.persistence.queries.DatabaseQuery.clone.

INTERNAL: Clone the query
protected void
clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session)

Overrides org.eclipse.persistence.queries.ReadQuery.clonedQueryExecutionComplete.

INTERNAL Used to give the subclasses opportunity to copy aspects of the cloned query to the original query.
public void
convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.queries.DatabaseQuery.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this query to actual class-based settings.
public void
copyFromQuery(DatabaseQuery query)

Overrides org.eclipse.persistence.queries.ReadQuery.copyFromQuery.

INTERNAL: Copy all setting from the query.
public Object
deepClone()

INTERNAL: Clone the query, including its selection criteria.

public void
dontRefreshIdentityMapResult()

PUBLIC: When unset means perform read normally and dont do refresh.

public void
dontRefreshRemoteIdentityMapResult()

PUBLIC: When unset means perform read normally and dont do refresh.

public List<E>
getDataResults()

INTERNAL: Return all of the rows fetched by the query, used for 1-m joining.

public FetchGroup
getExecutionFetchGroup()

INTERNAL: Returns FetchGroup that will be applied to the query.

public FetchGroup
getExecutionFetchGroup(ClassDescriptor descriptor)

INTERNAL: Returns FetchGroup that will be applied to the query.

public long
getExecutionTime()

INTERNAL: Return the time this query actually went to the database

public LoadGroup
getLoadGroup()

Return the load group set in the query.

public short
getLockMode()

PUBLIC: Return the current locking mode.

public Map<Object, CacheKey>
protected Object
getQueryPrimaryKey()

INTERNAL: Return the primary key stored in this query if there is one This is overridden by subclasses that actually hold a primary key

public Class<?>
getReferenceClass()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getReferenceClass.

PUBLIC: Return the reference class of the query.
public String
getReferenceClassName()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getReferenceClassName.

INTERNAL: Return the reference class of the query.
public boolean
hasExecutionFetchGroup()

INTERNAL: Indicates whether a FetchGroup will be applied to the query.

public boolean
hasPartialAttributeExpressions()

INTERNAL: Return if partial attributes.

public boolean
isAttributeJoined(ClassDescriptor mappingDescriptor, String attributeName)

INTERNAL: Return if the attribute is specified for joining.

public boolean
isCacheCheckComplete()

INTERNAL: Returns true if an early return cache check was completed

public boolean
isClonePessimisticLocked(Object clone, UnitOfWorkImpl uow)

INTERNAL: Helper method that checks if clone has been locked with uow.

public boolean
isDefaultLock()

INTERNAL: Helper method to determine the default mode.

public boolean
isLockQuery()

PUBLIC: Answers if the query lock mode is known to be LOCK or LOCK_NOWAIT.

public boolean
isObjectBuildingQuery()

Overrides org.eclipse.persistence.queries.DatabaseQuery.isObjectBuildingQuery.

PUBLIC: Return if this is an object building query.
public boolean
isRegisteringResults()

INTERNAL: Answers if we are executing through a UnitOfWork and registering results.

public void
postRegisterIndividualResult(Object clone, Object original, Object primaryKey, UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinManager, ClassDescriptor concreteDescriptor)

Post process the object once it is registered in the unit of work.

protected void
prepareCustomQuery(DatabaseQuery customQuery)

Overrides org.eclipse.persistence.queries.DatabaseQuery.prepareCustomQuery.

INTERNAL: Set the properties needed to be cascaded into the custom query including the translation row.
public void
prepareFromQuery(DatabaseQuery query)

Overrides org.eclipse.persistence.queries.DatabaseQuery.prepareFromQuery.

INTERNAL: Prepare the query from the prepared query.
public Boolean
printInnerJoinInWhereClause()

INTERNAL: Indicates whether the query will change the way that inner joins are printed in generated SQL for the database.

public void
recordCloneForPessimisticLocking(Object clone, UnitOfWorkImpl uow)

INTERNAL: Helper method that records clone with uow if query is pessimistic locking.

public void
refreshIdentityMapResult()

PUBLIC: Refresh the attributes of the object(s) resulting from the query.

public void
refreshRemoteIdentityMapResult()

PUBLIC: Refresh the attributes of the object(s) resulting from the query.

public Object

Returns:

a refreshed UnitOfWork queried object, unwrapped.
registerIndividualResult
(Object result, Object primaryKey, UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinManager, ClassDescriptor concreteDescriptor)

INTERNAL: Constructs the final (registered) object for every individual object queried via a UnitOfWork.

public boolean
requiresDeferredLocks()

INTERNAL: When reading across relationships, queries may be set to acquire deferred locks This is used to ensure any Eagerly fetched object that is the target of a relationship with an object the acquires deferred locks behaves the same as its owner

public void
setExecutionTime(long executionTime)

INTERNAL: Set the the time this query went to the database.

public void
setLockMode(short lockMode)

PUBLIC: Sets whether this is a pessimistically locking query.

public void
setPrefetchedCacheKeys(Map<Object, CacheKey> prefetchedCacheKeys)

public void
setPrintInnerJoinInWhereClause(boolean printInnerJoinInWhereClause)

INTERNAL: Set a flag that indicates whether the query will change the way that inner joins are printed in generated SQL for the database.

public void
setReferenceClass(Class<?> aClass)

REQUIRED: Set the reference class for the query.

public void
setReferenceClassName(String aClass)

INTERNAL: Set the reference class for the query.

public void
setRequiresDeferredLocks(boolean cascadeDeferredLocks)

INTERNAL: When reading across relationships, queries may be set to acquire deferred locks This is used to ensure any Eagerly fetched object that is the target of a relationship with an object the acquires deferred locks behaves the same as its owner

public void
setShouldBuildNullForNullPk(boolean shouldBuildNullForNullPk)

INTERNAL: If primary key is null ObjectBuilder.buildObject returns null in case this flag is set to true (instead of throwing exception).

public void
setShouldRefreshIdentityMapResult(boolean shouldRefreshIdentityMapResult)

PUBLIC: Set if the attributes of the object(s) resulting from the query should be refreshed.

public void
setShouldRefreshRemoteIdentityMapResult(boolean shouldRefreshIdentityMapResult)

PUBLIC: Set if the attributes of the object(s) resulting from the query should be refreshed.

public void
setShouldRegisterResultsInUnitOfWork(boolean shouldRegisterResultsInUnitOfWork)

INTERNAL: Set to false to have queries conform to a UnitOfWork without registering any additional objects not already in that UnitOfWork.

public 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 EclipseLink will ensure that the query is executed through the exclusive connection.

protected void
setWasDefaultLockMode(boolean wasDefaultLockMode)

INTERNAL: Set if this query originally used the default lock mode.

public boolean
shouldBuildNullForNullPk()

INTERNAL: If primary key is null ObjectBuilder.buildObject returns null in case this flag is set to true (instead of throwing exception).

public boolean
shouldReadAllMappings()

INTERNAL: Return if this is a full object query, not partial nor fetch group.

public boolean
shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup)

INTERNAL: Check if the mapping is part of the partial attributes.

public boolean
shouldRefreshIdentityMapResult()

PUBLIC: Set to a boolean.

public boolean
shouldRefreshRemoteIdentityMapResult()

PUBLIC: Set to a boolean.

public boolean

Returns:

true by default.
shouldRegisterResultsInUnitOfWork
()

INTERNAL: Allows one to do conforming in a UnitOfWork without registering.

public 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 EclipseLink will ensure that the query is executed through the exclusive connection.

public boolean
shouldUseSerializedObjectPolicy()

INTERNAL: Indicates whether the query should use SerializedObjectPolicy if descriptor has it.

private void
triggerJoinExpressions(UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinManager, Object clone, ClassDescriptor concreteDescriptor)

INTERNAL: Fetch/trigger indirection on the clone passed in, based on join expressions in the joinManager.

public boolean
usesResultSetAccessOptimization()

INTERNAL: Return if the query uses ResultSet optimization.

protected boolean
wasDefaultLockMode()

INTERNAL: Return if this query originally used the default lock mode.

Inherited from org.eclipse.persistence.queries.ReadQuery:
buildObjectcacheQueryResultscacheResultclearQueryResultsdoNotCacheQueryResultsgetFetchSizegetFirstResultgetInternalMaxgetMaxRowsgetQueryIdgetQueryResultsgetQueryResultsgetQueryResultsgetQueryResultsCachePolicygetTemporaryCachedQueryResultsisDefaultPropertiesQueryisReadQueryprepareprepareForExecutionremoteExecutesetAllowQueryResultsCacheValidationsetFetchSizesetFirstResultsetInternalMaxsetMaxRowssetQueryIdsetQueryResultssetQueryResultsCachePolicysetTemporaryCachedQueryResultsshouldAllowQueryResultsCacheValidationshouldCacheQueryResults

Field Detail

DEFAULT_LOCK_MODEback to summary
public static final short DEFAULT_LOCK_MODE
executionTimeback to summary
protected long executionTime

Used to set the read time on objects that use this query. Should be set to the time the query returned from the database.

isCacheCheckCompleteback to summary
protected boolean isCacheCheckComplete

was a check early return completed

LOCKback to summary
public static final short LOCK
LOCK_NOWAITback to summary
public static final short LOCK_NOWAIT
LOCK_RESULT_PROPERTYback to summary
public static final String LOCK_RESULT_PROPERTY

INTERNAL: This is the key for accessing unregistered and locked result in the query's properties. The uow and QueryBaseValueHolder use this property to record and to retrieve the result respectively.

lockingClauseback to summary
protected ForUpdateClause lockingClause

Used for pessimistic locking.

NO_LOCKback to summary
public static final short NO_LOCK
prefetchedCacheKeysback to summary
protected Map<Object, CacheKey> prefetchedCacheKeys
printInnerJoinInWhereClauseback to summary
protected Boolean printInnerJoinInWhereClause

Indicates whether the query printer/normalizer changes the way that inner joins are printed in generated SQL for the database. With a value of true, inner joins are printed in the WHERE clause, if false, inner joins are printed in the FROM clause. If value is set it overrides printInnerJoinInWhereClause persistence unit property. Default value null - value from printInnerJoinInWhereClause persistence unit property is used

referenceClassback to summary
protected Class<?> referenceClass

The class of the target objects to be read from the database.

referenceClassNameback to summary
protected String referenceClassName
requiresDeferredLocksback to summary
protected Boolean requiresDeferredLocks

When reading across relationships, queries may be set to acquire deferred locks This is used to ensure any Eagerly fetched object that is the target of a relationship with an object the acquires deferred locks behaves the same as its owner

shouldBuildNullForNullPkback to summary
protected boolean shouldBuildNullForNullPk

INTERNAL: If primary key is null ObjectBuilder.buildObject returns null in case this flag is set to true (instead of throwing exception).

shouldRefreshIdentityMapResultback to summary
protected boolean shouldRefreshIdentityMapResult

Allows for the resulting objects to be refresh with the data from the database.

shouldRefreshRemoteIdentityMapResultback to summary
protected boolean shouldRefreshRemoteIdentityMapResult
shouldRegisterResultsInUnitOfWorkback to summary
protected boolean shouldRegisterResultsInUnitOfWork

INTERNAL: for bug 2612601 allow ability not to register results in UOW.

shouldUseExclusiveConnectionback to summary
protected boolean shouldUseExclusiveConnection

Added for Exclusive Connection (VPD) support see accessor for information

wasDefaultLockModeback to summary
protected boolean wasDefaultLockMode

PERF: Store if the query originally used the default lock mode.

Constructor Detail

ObjectBuildingQueryback to summary
protected ObjectBuildingQuery()

INTERNAL: Initialize the state of the query

Method Detail

cloneback to summary
public Object clone()

Overrides org.eclipse.persistence.queries.DatabaseQuery.clone.

INTERNAL: Clone the query

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
clonedQueryExecutionCompleteback to summary
protected void clonedQueryExecutionComplete(DatabaseQuery query, AbstractSession session)

Overrides org.eclipse.persistence.queries.ReadQuery.clonedQueryExecutionComplete.

INTERNAL Used to give the subclasses opportunity to copy aspects of the cloned query to the original query.

Annotations
@Override
convertClassNamesToClassesback to summary
public void convertClassNamesToClasses(ClassLoader classLoader)

Overrides org.eclipse.persistence.queries.DatabaseQuery.convertClassNamesToClasses.

INTERNAL: Convert all the class-name-based settings in this query to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.

Annotations
@Override
copyFromQueryback to summary
public void copyFromQuery(DatabaseQuery query)

Overrides org.eclipse.persistence.queries.ReadQuery.copyFromQuery.

INTERNAL: Copy all setting from the query. This is used to morph queries from one type to the other. By default this calls prepareFromQuery, but additional properties may be required to be copied as prepareFromQuery only copies properties that affect the SQL.

Annotations
@Override
deepCloneback to summary
public Object deepClone()

INTERNAL: Clone the query, including its selection criteria.

Normally selection criteria are not cloned here as they are cloned later on during prepare.

dontRefreshIdentityMapResultback to summary
public void dontRefreshIdentityMapResult()

PUBLIC: When unset means perform read normally and dont do refresh.

dontRefreshRemoteIdentityMapResultback to summary
public void dontRefreshRemoteIdentityMapResult()

PUBLIC: When unset means perform read normally and dont do refresh.

getDataResultsback to summary
public List<E> getDataResults()

INTERNAL: Return all of the rows fetched by the query, used for 1-m joining.

getExecutionFetchGroupback to summary
public FetchGroup getExecutionFetchGroup()

INTERNAL: Returns FetchGroup that will be applied to the query. Note that the returned fetchGroup may be updated during preProcess.

getExecutionFetchGroupback to summary
public FetchGroup getExecutionFetchGroup(ClassDescriptor descriptor)

INTERNAL: Returns FetchGroup that will be applied to the query. Note that the returned fetchGroup may be updated during preProcess.

getExecutionTimeback to summary
public long getExecutionTime()

INTERNAL: Return the time this query actually went to the database

getLoadGroupback to summary
public LoadGroup getLoadGroup()

Return the load group set in the query.

getLockModeback to summary
public short getLockMode()

PUBLIC: Return the current locking mode.

getPrefetchedCacheKeysback to summary
public Map<Object, CacheKey> getPrefetchedCacheKeys()
getQueryPrimaryKeyback to summary
protected Object getQueryPrimaryKey()

INTERNAL: Return the primary key stored in this query if there is one This is overridden by subclasses that actually hold a primary key

See Also
ReadObjectQuery
getReferenceClassback to summary
public Class<?> getReferenceClass()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getReferenceClass.

PUBLIC: Return the reference class of the query.

Annotations
@Override
getReferenceClassNameback to summary
public String getReferenceClassName()

Overrides org.eclipse.persistence.queries.DatabaseQuery.getReferenceClassName.

INTERNAL: Return the reference class of the query.

Annotations
@Override
hasExecutionFetchGroupback to summary
public boolean hasExecutionFetchGroup()

INTERNAL: Indicates whether a FetchGroup will be applied to the query.

hasPartialAttributeExpressionsback to summary
public boolean hasPartialAttributeExpressions()

INTERNAL: Return if partial attributes.

isAttributeJoinedback to summary
public boolean isAttributeJoined(ClassDescriptor mappingDescriptor, String attributeName)

INTERNAL: Return if the attribute is specified for joining.

isCacheCheckCompleteback to summary
public boolean isCacheCheckComplete()

INTERNAL: Returns true if an early return cache check was completed

isClonePessimisticLockedback to summary
public boolean isClonePessimisticLocked(Object clone, UnitOfWorkImpl uow)

INTERNAL: Helper method that checks if clone has been locked with uow.

isDefaultLockback to summary
public boolean isDefaultLock()

INTERNAL: Helper method to determine the default mode. If true and quey has a pessimistic locking policy, locking will be configured according to the pessimistic locking policy.

isLockQueryback to summary
public boolean isLockQuery()

PUBLIC: Answers if the query lock mode is known to be LOCK or LOCK_NOWAIT. In the case of DEFAULT_LOCK_MODE and the query reference class being a CMP entity bean, at execution time LOCK, LOCK_NOWAIT, or NO_LOCK will be decided.

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.

isObjectBuildingQueryback to summary
public boolean isObjectBuildingQuery()

Overrides org.eclipse.persistence.queries.DatabaseQuery.isObjectBuildingQuery.

PUBLIC: Return if this is an object building query.

Annotations
@Override
isRegisteringResultsback to summary
public boolean isRegisteringResults()

INTERNAL: Answers if we are executing through a UnitOfWork and registering results. This is only ever false if using the conforming without registering feature.

postRegisterIndividualResultback to summary
public void postRegisterIndividualResult(Object clone, Object original, Object primaryKey, UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinManager, ClassDescriptor concreteDescriptor)

Post process the object once it is registered in the unit of work.

prepareCustomQueryback to summary
protected void prepareCustomQuery(DatabaseQuery customQuery)

Overrides org.eclipse.persistence.queries.DatabaseQuery.prepareCustomQuery.

INTERNAL: Set the properties needed to be cascaded into the custom query including the translation row. This is used only for primary key queries, as the descriptor query manager stores a predefined query for this query to avoid having to re-prepare and allow for customization.

Annotations
@Override
prepareFromQueryback to summary
public void prepareFromQuery(DatabaseQuery query)

Overrides org.eclipse.persistence.queries.DatabaseQuery.prepareFromQuery.

INTERNAL: Prepare the query from the prepared query. This allows a dynamic query to prepare itself directly from a prepared query instance. This is used in the EJBQL parse cache to allow preparsed queries to be used to prepare dynamic queries. This only copies over properties that are configured through EJBQL.

Annotations
@Override
printInnerJoinInWhereClauseback to summary
public Boolean printInnerJoinInWhereClause()

INTERNAL: Indicates whether the query will change the way that inner joins are printed in generated SQL for the database. With a value of true, inner joins are printed in the WHERE clause, if false, inner joins are printed in the FROM clause.

recordCloneForPessimisticLockingback to summary
public void recordCloneForPessimisticLocking(Object clone, UnitOfWorkImpl uow)

INTERNAL: Helper method that records clone with uow if query is pessimistic locking.

refreshIdentityMapResultback to summary
public void refreshIdentityMapResult()

PUBLIC: Refresh the attributes of the object(s) resulting from the query. If cascading is used the private parts of the objects will also be refreshed.

refreshRemoteIdentityMapResultback to summary
public void refreshRemoteIdentityMapResult()

PUBLIC: Refresh the attributes of the object(s) resulting from the query. If cascading is used the private parts of the objects will also be refreshed.

registerIndividualResultback to summary
public Object registerIndividualResult(Object result, Object primaryKey, UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinManager, ClassDescriptor concreteDescriptor)

INTERNAL: Constructs the final (registered) object for every individual object queried via a UnitOfWork.

Called for every object in a read all, the object in a read object, and every time the next or previous row is retrieved from a cursor.

The (conform) without registering feature is implemented here, and may return an original non UnitOfWork registered result.

Pessimistically locked objects are tracked here.

Returns:Object

a refreshed UnitOfWork queried object, unwrapped.

requiresDeferredLocksback to summary
public boolean requiresDeferredLocks()

INTERNAL: When reading across relationships, queries may be set to acquire deferred locks This is used to ensure any Eagerly fetched object that is the target of a relationship with an object the acquires deferred locks behaves the same as its owner

setExecutionTimeback to summary
public void setExecutionTime(long executionTime)

INTERNAL: Set the the time this query went to the database.

setLockModeback to summary
public void setLockMode(short lockMode)

PUBLIC: Sets whether this is a pessimistically locking query.

  • ObjectBuildingQuery.LOCK: SELECT .... FOR UPDATE issued.
  • ObjectBuildingQuery.LOCK_NOWAIT: SELECT .... FOR UPDATE NO WAIT issued.
  • ObjectBuildingQuery.NO_LOCK: no pessimistic locking.
  • ObjectBuildingQuery.DEFAULT_LOCK_MODE (default) and you have a CMP descriptor: fine grained locking will occur.

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"));

  • LOCK: all employees in Ottawa and all referenced Ottawa addresses will be locked.
  • DEFAULT_LOCK_MODE: if address is a joined attribute, and only address has a pessimistic locking policy, only referenced Ottawa addresses will be locked.
See Also
org.eclipse.persistence.descriptors.PessimisticLockingPolicy
setPrefetchedCacheKeysback to summary
public void setPrefetchedCacheKeys(Map<Object, CacheKey> prefetchedCacheKeys)
setPrintInnerJoinInWhereClauseback to summary
public void setPrintInnerJoinInWhereClause(boolean printInnerJoinInWhereClause)

INTERNAL: Set a flag that indicates whether the query will change the way that inner joins are printed in generated SQL for the database. With a value of true, inner joins are printed in the WHERE clause, if false, inner joins are printed in the FROM clause.

setReferenceClassback to summary
public void setReferenceClass(Class<?> aClass)

REQUIRED: Set the reference class for the query.

setReferenceClassNameback to summary
public void setReferenceClassName(String aClass)

INTERNAL: Set the reference class for the query.

setRequiresDeferredLocksback to summary
public void setRequiresDeferredLocks(boolean cascadeDeferredLocks)

INTERNAL: When reading across relationships, queries may be set to acquire deferred locks This is used to ensure any Eagerly fetched object that is the target of a relationship with an object the acquires deferred locks behaves the same as its owner

setShouldBuildNullForNullPkback to summary
public void setShouldBuildNullForNullPk(boolean shouldBuildNullForNullPk)

INTERNAL: If primary key is null ObjectBuilder.buildObject returns null in case this flag is set to true (instead of throwing exception).

setShouldRefreshIdentityMapResultback to summary
public void setShouldRefreshIdentityMapResult(boolean shouldRefreshIdentityMapResult)

PUBLIC: Set if the attributes of the object(s) resulting from the query should be refreshed. If cascading is used the private parts of the objects will also be refreshed.

setShouldRefreshRemoteIdentityMapResultback to summary
public void setShouldRefreshRemoteIdentityMapResult(boolean shouldRefreshIdentityMapResult)

PUBLIC: Set if the attributes of the object(s) resulting from the query should be refreshed. If cascading is used the private parts of the objects will also be refreshed.

setShouldRegisterResultsInUnitOfWorkback to summary
public void setShouldRegisterResultsInUnitOfWork(boolean shouldRegisterResultsInUnitOfWork)

INTERNAL: Set to false to have queries conform to a UnitOfWork without registering any additional objects not already in that UnitOfWork.

See Also
shouldRegisterResultsInUnitOfWork
setShouldUseExclusiveConnectionback to summary
public 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 EclipseLink will ensure that the query is executed through the exclusive connection. This may be required in certain cases. An example being where database security will prevent a query joining to a secure table from returning the correct results when executed through the shared connection.

setWasDefaultLockModeback to summary
protected void setWasDefaultLockMode(boolean wasDefaultLockMode)

INTERNAL: Set if this query originally used the default lock mode.

shouldBuildNullForNullPkback to summary
public boolean shouldBuildNullForNullPk()

INTERNAL: If primary key is null ObjectBuilder.buildObject returns null in case this flag is set to true (instead of throwing exception).

shouldReadAllMappingsback to summary
public boolean shouldReadAllMappings()

INTERNAL: Return if this is a full object query, not partial nor fetch group.

shouldReadMappingback to summary
public boolean shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup)

INTERNAL: Check if the mapping is part of the partial attributes.

shouldRefreshIdentityMapResultback to summary
public boolean shouldRefreshIdentityMapResult()

PUBLIC: Set to a boolean. When set means refresh the instance variables of referenceObject from the database.

shouldRefreshRemoteIdentityMapResultback to summary
public boolean shouldRefreshRemoteIdentityMapResult()

PUBLIC: Set to a boolean. When set means refresh the instance variables of referenceObject from the database.

shouldRegisterResultsInUnitOfWorkback to summary
public boolean shouldRegisterResultsInUnitOfWork()

INTERNAL: Allows one to do conforming in a UnitOfWork without registering. Queries executed on a UnitOfWork will only return working copies for objects that have already been registered.

Extreme care should be taken in using this feature, for a user will get back a mix of registered and original (unregistered) objects.

Best used with a WrapperPolicy where invoking on an object will trigger its registration (CMP). Without a WrapperPolicy registerExistingObject should be called on any object that you intend to change.

Returns:boolean

true by default.

See Also
setShouldRegisterResultsInUnitOfWork
shouldUseExclusiveConnectionback to summary
public 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 EclipseLink will ensure that the query is executed through the exclusive connection. This may be required in certain cases. An example being where database security will prevent a query joining to a secure table from returning the correct results when executed through the shared connection.

shouldUseSerializedObjectPolicyback to summary
public boolean shouldUseSerializedObjectPolicy()

INTERNAL: Indicates whether the query should use SerializedObjectPolicy if descriptor has it.

triggerJoinExpressionsback to summary
private void triggerJoinExpressions(UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinManager, Object clone, ClassDescriptor concreteDescriptor)

INTERNAL: Fetch/trigger indirection on the clone passed in, based on join expressions in the joinManager.

usesResultSetAccessOptimizationback to summary
public boolean usesResultSetAccessOptimization()

INTERNAL: Return if the query uses ResultSet optimization.

wasDefaultLockModeback to summary
protected boolean wasDefaultLockMode()

INTERNAL: Return if this query originally used the default lock mode.