Top Description Methods
org.eclipse.persistence.sessions

public Interface IdentityMapAccessor

Known Direct Implementers
org.eclipse.persistence.internal.sessions.IdentityMapAccessor
Imports
java.util.Collection, .Vector, org.eclipse.persistence.exceptions.QueryException, org.eclipse.persistence.expressions.Expression, org.eclipse.persistence.queries.InMemoryQueryIndirectionPolicy, .ReadQuery

PUBLIC: IdentityMapAccessor provides the public interface into all functionality associated with EclipseLink's cache. An appropriate IdentityMapAccessor can be obtained from a session with its getIdentityMapAccessor() method. Methods that used to be called on the Session to access identity maps can now be called through the IdentityMapAccessor.

For instance, to initialize identity maps the code used to be: session.initializeIdentityIdentityMaps()
With this class, the code now is:
session.getIdentityMapAccessor().initializeIdentityMaps()

See Also
org.eclipse.persistence.sessions.Session

Method Summary

Modifier and TypeMethod and Description
public void
clearQueryCache()

ADVANCED: Clear all the query caches

public void
clearQueryCache(ReadQuery query)

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

public void
clearQueryCache(String sessionQueryName)

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

public void
clearQueryCache(String descriptorQueryName, Class<?> queryClass)

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

public boolean
containsObjectInIdentityMap(Object domainObject)

ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type of the given domainObject.

public boolean
containsObjectInIdentityMap(Object primaryKey, Class<?> theClass)

ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type as those specified.

public boolean
containsObjectInIdentityMap(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Returns true if the identity map contains an Object with the same primary key of the specified row (i.e. the database record) and Class type.

public Vector<E>

Returns:

Vector of Objects
getAllFromIdentityMap
(Expression
Expression selecting the Objects to be returned
selectionCriteria
,
Class<?>
Class to be considered
theClass
,
DataRecord
Record
translationRow
,
InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean
boolean - true if only invalid Objects should be returned
shouldReturnInvalidatedObjects
)

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.

public Vector<E>

Returns:

Vector of Objects
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
)

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.

public Vector<E>

Returns:

Vector of Objects with type theClass and matching the selectionCriteria
getAllFromIdentityMap
(Expression
Expression selecting the Objects to be returned
selectionCriteria
,
Class<?>
Class to be considered
theClass
,
DataRecord
Record
translationRow
,
InMemoryQueryIndirectionPolicy valueHolderPolicy)

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.

public Vector<E>

Returns:

Vector of Objects with type theClass and matching the selectionCriteria
getAllFromIdentityMap
(Expression
Expression selecting the Objects to be returned
selectionCriteria
,
Class<?>
Class to be considered
theClass
,
DataRecord
Record
translationRow
,
int valueHolderPolicy)

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.

public Object

Returns:

Object from identity map, may be null.
getFromIdentityMap
(Object
Object
domainObject
)

ADVANCED: Returns the Object from the identity map with the same primary key and Class type of the given domainObject.

public Object

Returns:

Object from identity map, may be null.
getFromIdentityMap
(Object primaryKey, Class<?> theClass)

ADVANCED: Returns the Object from the identity map with the same primary key and Class type as those specified.

public Object

Returns:

Object from identity map, may be null.
getFromIdentityMap
(DataRecord
Record
rowContainingPrimaryKey
,
Class<?>
Class
theClass
)

ADVANCED: Returns the Object from the identity map with the same primary key of the specified row (i.e. the database record) and Class type.

public Object

Returns:

Object from identity map, may be null.
getFromIdentityMap
(Object primaryKey, Class<?> theClass, boolean shouldReturnInvalidatedObjects)

ADVANCED: Returns the Object from the identity map with the same primary key and Class type as specified.

public Object

Returns:

Object from identity map, may be null.
getFromIdentityMap
(DataRecord
Record
rowContainingPrimaryKey
,
Class<?>
Class
theClass
,
boolean
boolean
shouldReturnInvalidatedObjects
)

ADVANCED: Returns the Object from the identity map with the same primary key of the specified row and Class type.

public Object

Returns:

Object from identity map, may be null
getFromIdentityMap
(Expression
Expression
selectionCriteria
,
Class<?>
Class
theClass
,
DataRecord
Record
translationRow
)

ADVANCED: Queries the cache in-memory and returns an Object from this identity map.

public Object

Returns:

Object from identity map, may be null
getFromIdentityMap
(Expression
Expression
selectionCriteria
,
Class<?>
Class
theClass
,
DataRecord
Record
translationRow
,
InMemoryQueryIndirectionPolicy valueHolderPolicy)

ADVANCED: Queries the cache in-memory and returns an Object from this identity map.

public Object

Returns:

Object from identity map, may be null
getFromIdentityMap
(Expression
Expression
selectionCriteria
,
Class<?>
Class
theClass
,
DataRecord
Record
translationRow
,
int valueHolderPolicy)

ADVANCED: Queries the cache in-memory and returns an Object from this identity map.

public long

Returns:

long time in milliseconds
getRemainingValidTime
(Object
Object under consideration
object
)

ADVANCED: Returns the remaining life of the given Object.

public Object

Returns:

Object for versioning
getWriteLockValue
(Object
Object
domainObject
)

ADVANCED: Extracts and returns the write lock value from the identity map through the given Object.

public Object
getWriteLockValue(Object primaryKey, Class<?> theClass)

ADVANCED: Extracts the write lock value from the identity map through the passed in primaryKey and Class type.

public void
initializeAllIdentityMaps()

PUBLIC: Resets the entire Object cache.

public void
initializeIdentityMap(Class<?>
Class
theClass
)

PUBLIC: Resets the identity map for only the instances of the given Class type.

public void
initializeIdentityMaps()

PUBLIC: Resets the entire local Object cache.

public void
invalidateAll()

ADVANCED: Sets all of the Objects for all classes to be invalid in the cache.

public void
invalidateClass(Class<?> theClass)

ADVANCED: Sets all of the Objects of the specified Class type to be invalid in the cache.

public void
invalidateClass(Class<?>
Class
theClass
,
boolean
boolean
recurse
)

ADVANCED: Sets all of the Objects of the specified Class type to be invalid in the cache.

public void
invalidateObject(Object
Object
object
)

ADVANCED: Sets an Object to be invalid in the cache.

public void
invalidateObject(Object object, boolean
if true the invalidation will be broadcast to each server in the cluster.
invalidateCluster
)

ADVANCED: Set an object to be invalid in the cache.

public void
invalidateObject(Object primaryKey, Class<?> theClass)

ADVANCED: Sets an Object with the specified primary key and Class type to be invalid in the cache.

public void
invalidateObject(Object primaryKey, Class<?> theClass, boolean
if true the invalidation will be broadcast to each server in the cluster.
invalidateCluster
)

ADVANCED: Set an object to be invalid in the cache.

public void
invalidateObject(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Sets an Object with the specified primary key of the passed in Row and Class type to be invalid in the cache.

public void
invalidateObject(DataRecord rowContainingPrimaryKey, Class<?> theClass, boolean
if true the invalidation will be broadcast to each server in the cluster.
invalidateCluster
)

ADVANCED: Set an object to be invalid in the cache.

public void
invalidateObjects(Collection<E>
objects to be invalidated
collection
)

ADVANCED: Sets all of the Objects in the given collection to be invalid in the TopLink identity maps.

public void
invalidateObjects(Collection<E> collection, boolean
if true the invalidation will be broadcast to each server in the cluster.
invalidateCluster
)

ADVANCED: Set all of the objects in the given collection to be invalid in the cache.

public void
invalidateObjects(Expression
Expression
selectionCriteria
)

ADVANCED: Sets all of the Objects matching the given Expression to be invalid in the cache.

public void
invalidateObjects(Expression
Expression selecting the Objects to be returned
selectionCriteria
,
Class<?>
Class to be considered
theClass
,
DataRecord
Record
translationRow
,
boolean
boolean indicates weather to invalidate the object if conform threw exception.
shouldInvalidateOnException
)

ADVANCED: Queries the cache in-memory with the passed in criteria and invalidates matching Objects.

public void
invalidateQueryCache(Class<?> classThatChanged)

ADVANCED: Invalidate/remove any results for any query for the class from the query cache.

public boolean
isValid(Object object)

ADVANCED: Returns true if an Object with the same primary key and Class type of the the given Object is valid in the cache.

public boolean
isValid(Object primaryKey, Class<?> theClass)

ADVANCED: Returns true if the Object described by the given primary key and Class type is valid in the cache.

public boolean
isValid(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Returns true if this Object with the given primary key of the Row and Class type given is valid in the cache.

public void
printIdentityMap(Class<?> theClass)

PUBLIC: Used to print all the Objects in the identity map of the given Class type.

public void
printIdentityMapLocks()

PUBLIC: Used to print all the locks in every identity map in this session.

public void
printIdentityMaps()

PUBLIC: Used to print all the Objects in every identity map in this session.

public Object

Returns:

Object
putInIdentityMap
(Object
Object
domainObject
)

ADVANCED: Registers the given Object with the identity map.

public Object
putInIdentityMap(Object domainObject, Object key)

ADVANCED: Registers the Object and given key with the identity map.

public Object
putInIdentityMap(Object domainObject, Object key, Object writeLockValue)

ADVANCED: Registers the Object and given key with the identity map.

public Object

Returns:

Object the Object put into the identity map
putInIdentityMap
(Object
Object
domainObject
,
Object
Object
key
,
Object
Object for versioning
writeLockValue
,
long
long, time in milliseconds
readTime
)

ADVANCED: Registers the given Object with the identity map.

public Object

Returns:

Object the Object removed from the identity map
removeFromIdentityMap
(Object
Object
domainObject
)

ADVANCED: Removes the Object from the Object cache.

public Object

Returns:

Object the Object removed from the identity map
removeFromIdentityMap
(Object key, Class<?> theClass)

ADVANCED: Removes the Object with given primary key and Class from the Object cache.

public void
updateWriteLockValue(Object
Object
domainObject
,
Object
Object for versioning
writeLockValue
)

ADVANCED: Updates the write lock value in the identity map for cache key of the primary key the given Object.

public void
updateWriteLockValue(Object primaryKey, Class<?> theClass, Object writeLockValue)

ADVANCED: Updates the write lock value in the cache for the Object with same primary key as the given Object.

public void
validateCache()

ADVANCED: This can be used to help debugging an Object identity problem.

Method Detail

clearQueryCacheback to summary
public void clearQueryCache()

ADVANCED: Clear all the query caches

clearQueryCacheback to summary
public void clearQueryCache(ReadQuery query)

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

clearQueryCacheback to summary
public void clearQueryCache(String sessionQueryName)

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

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

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

containsObjectInIdentityMapback to summary
public boolean containsObjectInIdentityMap(Object domainObject)

ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type of the given domainObject.

containsObjectInIdentityMapback to summary
public boolean containsObjectInIdentityMap(Object primaryKey, Class<?> theClass)

ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type as those specified.

containsObjectInIdentityMapback to summary
public boolean containsObjectInIdentityMap(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Returns true if the identity map contains an Object with the same primary key of the specified row (i.e. the database record) and Class type.

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

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects. If the expression is too complex an exception will be thrown. Only returns Objects that are invalid from the map if specified with the boolean shouldReturnInvalidatedObjects.

Parameters
selectionCriteria:Expression

Expression selecting the Objects to be returned

theClass:Class<?>

Class to be considered

translationRow:DataRecord

Record

valueHolderPolicy:InMemoryQueryIndirectionPolicy

see InMemoryQueryIndirectionPolicy

shouldReturnInvalidatedObjects:boolean

boolean - true if only invalid Objects should be returned

Returns:Vector<E>

Vector of Objects

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

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects. If the expression is too complex an exception will be thrown. Only returns Objects that are invalid from the map if specified with the boolean shouldReturnInvalidatedObjects.

Parameters
selectionCriteria:Expression

Expression selecting the Objects to be returned

theClass:Class<?>

Class to be considered

translationRow:DataRecord

Record

valueHolderPolicy:int

see InMemoryQueryIndirectionPolicy

shouldReturnInvalidatedObjects:boolean

boolean - true if only invalid Objects should be returned

Returns:Vector<E>

Vector of Objects

getAllFromIdentityMapback to summary
public Vector<E> getAllFromIdentityMap(Expression selectionCriteria, Class<?> theClass, DataRecord translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy) throws QueryException

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects. If the expression is too complex an exception will be thrown.

Parameters
selectionCriteria:Expression

Expression selecting the Objects to be returned

theClass:Class<?>

Class to be considered

translationRow:DataRecord

Record

valueHolderPolicy:InMemoryQueryIndirectionPolicy

see InMemoryQueryIndirectionPolicy

Returns:Vector<E>

Vector of Objects with type theClass and matching the selectionCriteria

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

ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects. If the expression is too complex an exception will be thrown.

Parameters
selectionCriteria:Expression

Expression selecting the Objects to be returned

theClass:Class<?>

Class to be considered

translationRow:DataRecord

Record

valueHolderPolicy:int

see InMemoryQueryIndirectionPolicy

Returns:Vector<E>

Vector of Objects with type theClass and matching the selectionCriteria

getFromIdentityMapback to summary
public Object getFromIdentityMap(Object domainObject)

ADVANCED: Returns the Object from the identity map with the same primary key and Class type of the given domainObject.

Parameters
domainObject:Object

Object

Returns:Object

Object from identity map, may be null.

getFromIdentityMapback to summary
public Object getFromIdentityMap(Object primaryKey, Class<?> theClass)

ADVANCED: Returns the Object from the identity map with the same primary key and Class type as those specified.

Returns:Object

Object from identity map, may be null.

getFromIdentityMapback to summary
public Object getFromIdentityMap(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Returns the Object from the identity map with the same primary key of the specified row (i.e. the database record) and Class type.

Parameters
rowContainingPrimaryKey:DataRecord

Record

theClass:Class<?>

Class

Returns:Object

Object from identity map, may be null.

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

ADVANCED: Returns the Object from the identity map with the same primary key and Class type as specified. May return null and will only return an Object that is invalidated if specified with the boolean shouldReturnInvalidatedObjects.

Returns:Object

Object from identity map, may be null.

getFromIdentityMapback to summary
public Object getFromIdentityMap(DataRecord rowContainingPrimaryKey, Class<?> theClass, boolean shouldReturnInvalidatedObjects)

ADVANCED: Returns the Object from the identity map with the same primary key of the specified row and Class type. May return null and will only Only return an Object that is invalidated if specified with the boolean shouldReturnInvalidatedObjects.

Parameters
rowContainingPrimaryKey:DataRecord

Record

theClass:Class<?>

Class

shouldReturnInvalidatedObjects:boolean

boolean

Returns:Object

Object from identity map, may be null.

getFromIdentityMapback to summary
public Object getFromIdentityMap(Expression selectionCriteria, Class<?> theClass, DataRecord translationRow) throws QueryException

ADVANCED: Queries the cache in-memory and returns an Object from this identity map. If the Object is not found with the passed in Class type, Row and selectionCriteria, null is returned. If the expression is too complex an exception will be thrown.

Parameters
selectionCriteria:Expression

Expression

theClass:Class<?>

Class

translationRow:DataRecord

Record

Returns:Object

Object from identity map, may be null

getFromIdentityMapback to summary
public Object getFromIdentityMap(Expression selectionCriteria, Class<?> theClass, DataRecord translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy) throws QueryException

ADVANCED: Queries the cache in-memory and returns an Object from this identity map. If the Object is not found with the passed in Class type, Row and selectionCriteria, null is returned. This method allows for control of un-instantiated indirection access with valueHolderPolicy. If the expression is too complex an exception will be thrown.

Parameters
selectionCriteria:Expression

Expression

theClass:Class<?>

Class

translationRow:DataRecord

Record

valueHolderPolicy:InMemoryQueryIndirectionPolicy

see InMemoryQueryIndirectionPolicy

Returns:Object

Object from identity map, may be null

getFromIdentityMapback to summary
public Object getFromIdentityMap(Expression selectionCriteria, Class<?> theClass, DataRecord translationRow, int valueHolderPolicy) throws QueryException

ADVANCED: Queries the cache in-memory and returns an Object from this identity map. If the Object is not found with the passed in Class type, Row and selectionCriteria, null is returned. This method allows for control of un-instantiated indirection access with valueHolderPolicy. If the expression is too complex an exception will be thrown.

Parameters
selectionCriteria:Expression

Expression

theClass:Class<?>

Class

translationRow:DataRecord

Record

valueHolderPolicy:int

see InMemoryQueryIndirectionPolicy

Returns:Object

Object from identity map, may be null

getRemainingValidTimeback to summary
public long getRemainingValidTime(Object object)

ADVANCED: Returns the remaining life of the given Object. This method is associated with use of cache invalidation feature and returns the difference between the next expiry time of the Object and its read time. The method will return 0 for invalidated Objects.

Parameters
object:Object

Object under consideration

Returns:long

long time in milliseconds

getWriteLockValueback to summary
public Object getWriteLockValue(Object domainObject)

ADVANCED: Extracts and returns the write lock value from the identity map through the given Object. Write lock values are used when optimistic locking is stored in the cache instead of the object.

Parameters
domainObject:Object

Object

Returns:Object

Object for versioning

getWriteLockValueback to summary
public Object getWriteLockValue(Object primaryKey, Class<?> theClass)

ADVANCED: Extracts the write lock value from the identity map through the passed in primaryKey and Class type. Write lock values are used when optimistic locking is stored in the cache instead of the object.

initializeAllIdentityMapsback to summary
public void initializeAllIdentityMaps()

PUBLIC: Resets the entire Object cache.

Note

Be careful using this method. This method blows away both this session's and its parent's 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 Objects held in the cache.

initializeIdentityMapback to summary
public void initializeIdentityMap(Class<?> theClass)

PUBLIC: Resets the identity map for only the instances of the given Class type. For inheritance the user must make sure that they only use the root class.

Note

Caution must be used in doing this to ensure that the Objects within the identity map are not referenced from other Objects of other classes or from the application.

Parameters
theClass:Class<?>

Class

initializeIdentityMapsback to summary
public void initializeIdentityMaps()

PUBLIC: Resets the entire local Object cache.

Note

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 Objects held in the cache.

invalidateAllback to summary
public void invalidateAll()

ADVANCED: Sets all of the Objects for all classes to be invalid in the cache. It will recurse on inheritance.

invalidateClassback to summary
public void invalidateClass(Class<?> theClass)

ADVANCED: Sets all of the Objects of the specified Class type to be invalid in the cache. Will set the recurse on inheritance to true.

invalidateClassback to summary
public void invalidateClass(Class<?> theClass, boolean recurse)

ADVANCED: Sets all of the Objects of the specified Class type to be invalid in the cache. User can set the recurse flag to false if they do not want to invalidate all the same Class types within an inheritance tree.

Parameters
theClass:Class<?>

Class

recurse:boolean

boolean

invalidateObjectback to summary
public void invalidateObject(Object object)

ADVANCED: Sets an Object to be invalid in the cache. If this Object does not exist in the cache, this method will return without any action.

Parameters
object:Object

Object

invalidateObjectback to summary
public void invalidateObject(Object object, boolean invalidateCluster)

ADVANCED: Set an object to be invalid in the cache.

Parameters
invalidateCluster:boolean

if true the invalidation will be broadcast to each server in the cluster.

invalidateObjectback to summary
public void invalidateObject(Object primaryKey, Class<?> theClass)

ADVANCED: Sets an Object with the specified primary key and Class type to be invalid in the cache. If the Object does not exist in the cache, this method will return without any action.

invalidateObjectback to summary
public void invalidateObject(Object primaryKey, Class<?> theClass, boolean invalidateCluster)

ADVANCED: Set an object to be invalid in the cache.

Parameters
invalidateCluster:boolean

if true the invalidation will be broadcast to each server in the cluster.

invalidateObjectback to summary
public void invalidateObject(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Sets an Object with the specified primary key of the passed in Row and Class type to be invalid in the cache. If the Object does not exist in the cache, this method will return without any action.

invalidateObjectback to summary
public void invalidateObject(DataRecord rowContainingPrimaryKey, Class<?> theClass, boolean invalidateCluster)

ADVANCED: Set an object to be invalid in the cache.

Parameters
invalidateCluster:boolean

if true the invalidation will be broadcast to each server in the cluster.

invalidateObjectsback to summary
public void invalidateObjects(Collection<E> collection)

ADVANCED: Sets all of the Objects in the given collection to be invalid in the TopLink identity maps. This method will take no action for any Objects in the collection that do not exist in the cache.

Parameters
collection:Collection<E>

objects to be invalidated

invalidateObjectsback to summary
public void invalidateObjects(Collection<E> collection, boolean invalidateCluster)

ADVANCED: Set all of the objects in the given collection to be invalid in the cache.

Parameters
invalidateCluster:boolean

if true the invalidation will be broadcast to each server in the cluster.

invalidateObjectsback to summary
public void invalidateObjects(Expression selectionCriteria)

ADVANCED: Sets all of the Objects matching the given Expression to be invalid in the cache.

Example - Invalidating Employee Objects with non-null first names:

ExpressionBuilder eb = new ExpressionBuilder(Employee.class);
Expression exp = eb.get("firstName").notNull();
session.getIdentityMapAccessor().invalidateObjects(exp);

Parameters
selectionCriteria:Expression

Expression

invalidateObjectsback to summary
public void invalidateObjects(Expression selectionCriteria, Class<?> theClass, DataRecord translationRow, boolean shouldInvalidateOnException)

ADVANCED: Queries the cache in-memory with the passed in criteria and invalidates matching Objects. If the expression is too complex either all or none object of theClass invalidated (depending on shouldInvalidateOnException value).

Parameters
selectionCriteria:Expression

Expression selecting the Objects to be returned

theClass:Class<?>

Class to be considered

translationRow:DataRecord

Record

shouldInvalidateOnException:boolean

boolean indicates weather to invalidate the object if conform threw exception.

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

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

isValidback to summary
public boolean isValid(Object object)

ADVANCED: Returns true if an Object with the same primary key and Class type of the the given Object is valid in the cache.

isValidback to summary
public boolean isValid(Object primaryKey, Class<?> theClass)

ADVANCED: Returns true if the Object described by the given primary key and Class type is valid in the cache.

isValidback to summary
public boolean isValid(DataRecord rowContainingPrimaryKey, Class<?> theClass)

ADVANCED: Returns true if this Object with the given primary key of the Row and Class type given is valid in the cache.

printIdentityMapback to summary
public void printIdentityMap(Class<?> theClass)

PUBLIC: Used to print all the Objects in the identity map of the given Class type. The output of this method will be logged to this session's SessionLog at SEVERE level.

printIdentityMapLocksback to summary
public void printIdentityMapLocks()

PUBLIC: Used to print all the locks in every identity map in this session. The output of this method will be logged to this session's SessionLog at FINEST level.

printIdentityMapsback to summary
public void printIdentityMaps()

PUBLIC: Used to print all the Objects in every identity map in this session. The output of this method will be logged to this session's SessionLog at SEVERE level.

putInIdentityMapback to summary
public Object putInIdentityMap(Object domainObject)

ADVANCED: Registers the given Object with the identity map. The Object must always be registered with its version number if optimistic locking is used.

Parameters
domainObject:Object

Object

Returns:Object

Object

putInIdentityMapback to summary
public Object putInIdentityMap(Object domainObject, Object key)

ADVANCED: Registers the Object and given key with the identity map. The Object must always be registered with its version number if optimistic locking is used.

putInIdentityMapback to summary
public Object putInIdentityMap(Object domainObject, Object key, Object writeLockValue)

ADVANCED: Registers the Object and given key with the identity map. The Object must always be registered with its version number if optimistic locking is used.

putInIdentityMapback to summary
public Object putInIdentityMap(Object domainObject, Object key, Object writeLockValue, long readTime)

ADVANCED: Registers the given Object with the identity map. The Object must always be registered with its version number if optimistic locking is used. The readTime may also be included in the cache key as it is constructed.

Parameters
domainObject:Object

Object

key:Object

Object

writeLockValue:Object

Object for versioning

readTime:long

long, time in milliseconds

Returns:Object

Object the Object put into the identity map

removeFromIdentityMapback to summary
public Object removeFromIdentityMap(Object domainObject)

ADVANCED: Removes the Object from the Object cache.

Note

Caution should be used when calling to avoid violating Object identity. The application should only call this if its known that no references to the Object exist.

Parameters
domainObject:Object

Object

Returns:Object

Object the Object removed from the identity map

removeFromIdentityMapback to summary
public Object removeFromIdentityMap(Object key, Class<?> theClass)

ADVANCED: Removes the Object with given primary key and Class from the Object cache.

Note

Caution should be used when calling to avoid violating Object identity. The application should only call this if its known that no references to the Object exist.

Returns:Object

Object the Object removed from the identity map

updateWriteLockValueback to summary
public void updateWriteLockValue(Object domainObject, Object writeLockValue)

ADVANCED: Updates the write lock value in the identity map for cache key of the primary key the given Object.

Parameters
domainObject:Object

Object

writeLockValue:Object

Object for versioning

updateWriteLockValueback to summary
public void updateWriteLockValue(Object primaryKey, Class<?> theClass, Object writeLockValue)

ADVANCED: Updates the write lock value in the cache for the Object with same primary key as the given Object. The write lock values is used when optimistic locking is stored in the cache instead of in the object.

validateCacheback to summary
public void validateCache()

ADVANCED: This can be used to help debugging an Object identity problem. An Object identity problem is when an Object in the cache references an Object that is not in the cache. This method will validate that all cached Objects are in a correct state.