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

public Class UnitOfWorkIdentityMapAccessor

extends IdentityMapAccessor
Class Inheritance
Imports
java.util.*, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.descriptors.PersistenceEntity, org.eclipse.persistence.internal.identitymaps.*, org.eclipse.persistence.expressions.*, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.queries.*, org.eclipse.persistence.sessions.DataRecord

INTERNAL: IdentityMapAccessor subclass for UnitOfWork Overrides some initialization functionality and some behavior having to do with getting objects from identity maps.

Field Summary

Inherited from org.eclipse.persistence.internal.sessions.IdentityMapAccessor:
identityMapManagersession

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected Object
checkForInheritance(Object domainObject, Class<?> superClass, ClassDescriptor descriptor)

This method is used to resolve the inheritance issues arise while trying to get object from identity map of parent session.

public void
public void
public void
clearQueryCache(String sessionQueryName)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.clearQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.clearQueryCache.

ADVANCED: Clear the query cache associated with the named query on the session
public void
clearQueryCache(String descriptorQueryName, Class<?> queryClass)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.clearQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.clearQueryCache.

ADVANCED: Clear the query cache associated with the named query on the descriptor for the given class
public boolean
containsObjectInIdentityMap(Object primaryKey, Class<?> theClass, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.containsObjectInIdentityMap.

INTERNAL: Return if their is an object for the primary key.
public Vector<E>
getAllFromIdentityMap(Expression
Expression selecting the Objects to be returned
selectionCriteria
,
Class<?>
Class to be considered
theClass
,
DataRecord
Record
translationRow
,
int valueHolderPolicy, boolean
boolean - true if only invalid Objects should be returned
shouldReturnInvalidatedObjects
)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getAllFromIdentityMap.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

INTERNAL: This method overrides the getAllFromIdentityMap method in Session.
protected Object
getAndCloneCacheKeyFromParent(Object primaryKey, Object objectToClone, Class<?> theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)

INTERNAL: This method will return the object from the parent and clone it.

public Object
getFromIdentityMap(Object primaryKey, Object object, Class<?> theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getFromIdentityMap.

INTERNAL: Return the object from the identity map with the primary key and class.
public Object
getFromIdentityMapWithDeferredLock(Object primaryKey, Class<?> theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getFromIdentityMapWithDeferredLock.

INTERNAL: Override the getFromIdentityMapWithDeferredLock method on the session to ensure that invalidated objects are always returned since this is a UnitOfWork
public Object
getQueryResult(ReadQuery query, List<E> parameters, boolean checkExpiry)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getQueryResult.

INTERNAL: Get the cached results associated with a query.
public void
public void
public void
putQueryResult(ReadQuery query, List<E> parameters, Object results)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.putQueryResult.

INTERNAL: Set the results for a query.
Inherited from org.eclipse.persistence.internal.sessions.IdentityMapAccessor:
acquireDeferredLockacquireLockacquireLockacquireLockNoWaitacquireLockWithWaitacquireReadLockOnCacheKeyacquireReadLockOnCacheKeyNoWaitacquireWriteLockcontainsObjectInIdentityMapcontainsObjectInIdentityMapcontainsObjectInIdentityMapextractPrimaryKeyFromRowgetAllCacheKeysFromIdentityMapWithEntityPKgetAllFromIdentityMapgetAllFromIdentityMapgetAllFromIdentityMapgetAllFromIdentityMapgetAllFromIdentityMapWithEntityPKgetCacheKeyByIndexgetCacheKeyForObjectgetCacheKeyForObjectgetCacheKeyForObjectgetCacheKeyForObjectForLockgetClassesRegisteredgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapgetFromIdentityMapWithDeferredLockgetFromLocalIdentityMapgetFromLocalIdentityMapWithDeferredLockgetIdentityMapgetIdentityMapgetIdentityMapgetIdentityMapManagergetRemainingValidTimegetSessiongetWrappergetWriteLockManagergetWriteLockValuegetWriteLockValuegetWriteLockValueinitializeIdentityMapinitializeIdentityMapsinternalPutInIdentityMapinvalidateAllinvalidateClassinvalidateClassinvalidateObjectinvalidateObjectinvalidateObjectinvalidateObjectinvalidateObjectinvalidateObjectinvalidateObjectsinvalidateObjectsinvalidateObjectsinvalidateObjectsisValidisValidisValidprintIdentityMapprintIdentityMapLocksprintIdentityMapsputCacheKeyByIndexputInIdentityMapputInIdentityMapputInIdentityMapputInIdentityMapputInIdentityMapreleaseWriteLockremoveFromIdentityMapremoveFromIdentityMapremoveFromIdentityMapsetIdentityMapManagersetWrapperupdateWriteLockValueupdateWriteLockValuevalidateCache

Constructor Detail

UnitOfWorkIdentityMapAccessorback to summary
public UnitOfWorkIdentityMapAccessor()
UnitOfWorkIdentityMapAccessorback to summary
public UnitOfWorkIdentityMapAccessor(AbstractSession session, IdentityMapManager identityMapManager)

Method Detail

checkForInheritanceback to summary
protected Object checkForInheritance(Object domainObject, Class<?> superClass, ClassDescriptor descriptor)

This method is used to resolve the inheritance issues arise while trying to get object from identity map of parent session. Avoid reading the unintended subclass during in-memory query (e.g. when querying on large project, do not want to check small project, both are inherited from the project, and stored in the same identity map).

clearQueryCacheback to summary
public void clearQueryCache()

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.clearQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.clearQueryCache.

ADVANCED: Clear all the query caches

Annotations
@Override
clearQueryCacheback to summary
public void clearQueryCache(ReadQuery query)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.clearQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.clearQueryCache.

ADVANCED: Clear the query class associated with the passed-in read query

Annotations
@Override
clearQueryCacheback to summary
public void clearQueryCache(String sessionQueryName)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.clearQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.clearQueryCache.

ADVANCED: Clear the query cache associated with the named query on the session

Annotations
@Override
clearQueryCacheback to summary
public void clearQueryCache(String descriptorQueryName, Class<?> queryClass)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.clearQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.clearQueryCache.

ADVANCED: Clear the query cache associated with the named query on the descriptor for the given class

Annotations
@Override
containsObjectInIdentityMapback to summary
public boolean containsObjectInIdentityMap(Object primaryKey, Class<?> theClass, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.containsObjectInIdentityMap.

INTERNAL: Return if their is an object for the primary key.

Annotations
@Override
getAllFromIdentityMapback to summary
public Vector<E> getAllFromIdentityMap(Expression selectionCriteria, Class<?> theClass, DataRecord translationRow, int valueHolderPolicy, boolean shouldReturnInvalidatedObjects) throws QueryException

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getAllFromIdentityMap.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

INTERNAL: This method overrides the getAllFromIdentityMap method in Session. Invalidated Objects will always be returned from a UnitOfWork.

Parameters
selectionCriteria:Expression

Doc from org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

Expression selecting the Objects to be returned

theClass:Class<?>

Doc from org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

Class to be considered

translationRow:DataRecord

Doc from org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

Record

valueHolderPolicy:int

Doc from org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

see InMemoryQueryIndirectionPolicy

shouldReturnInvalidatedObjects:boolean

Doc from org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

boolean - true if only invalid Objects should be returned

Returns:Vector<E>

Doc from org.eclipse.persistence.sessions.IdentityMapAccessor.getAllFromIdentityMap.

Vector of Objects

Annotations
@Override
getAndCloneCacheKeyFromParentback to summary
protected Object getAndCloneCacheKeyFromParent(Object primaryKey, Object objectToClone, Class<?> theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)

INTERNAL: This method will return the object from the parent and clone it.

getFromIdentityMapback to summary
public Object getFromIdentityMap(Object primaryKey, Object object, Class<?> theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getFromIdentityMap.

INTERNAL: Return the object from the identity map with the primary key and class. The parent's cache must be checked after the child's, if found in the parent, it must be registered/cloned (but must avoid looping).

Note

in a UnitOfWork, invalidated objects will always be returned from the identity map In the parent session, only return the object if it has not been Invalidated

Annotations
@Override
getFromIdentityMapWithDeferredLockback to summary
public Object getFromIdentityMapWithDeferredLock(Object primaryKey, Class<?> theClass, boolean shouldReturnInvalidatedObjects, ClassDescriptor descriptor)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getFromIdentityMapWithDeferredLock.

INTERNAL: Override the getFromIdentityMapWithDeferredLock method on the session to ensure that invalidated objects are always returned since this is a UnitOfWork

Annotations
@Override
getQueryResultback to summary
public Object getQueryResult(ReadQuery query, List<E> parameters, boolean checkExpiry)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.getQueryResult.

INTERNAL: Get the cached results associated with a query. Results are cached by the values of the parameters to the query so different parameters will have different cached results. results are only cached in the parent session for UnitOfWorks

Annotations
@Override
initializeAllIdentityMapsback to summary
public void initializeAllIdentityMaps()

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.initializeAllIdentityMaps.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.initializeAllIdentityMaps.

INTERNAL: Reset the entire object cache, ** be careful using this. This method blows away both this session's and its parents caches, this includes the server cache or any other cache. This throws away any objects that have been read in. Extreme caution should be used before doing this because object identity will no longer be maintained for any objects currently read in. This should only be called if the application knows that it no longer has references to object held in the cache.

Annotations
@Override
invalidateQueryCacheback to summary
public void invalidateQueryCache(Class<?> classThatChanged)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.invalidateQueryCache.

Implements org.eclipse.persistence.sessions.IdentityMapAccessor.invalidateQueryCache.

Invalidate/remove any results for the class from the query cache. This is used to invalidate the query cache on any change.

Annotations
@Override
putQueryResultback to summary
public void putQueryResult(ReadQuery query, List<E> parameters, Object results)

Overrides org.eclipse.persistence.internal.sessions.IdentityMapAccessor.putQueryResult.

INTERNAL: Set the results for a query. Query results are cached based on the parameter values provided to the query different parameter values access different caches. Results are only cached in the parent session for UnitOfWorks

Annotations
@Override