EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.sessions
Interface IdentityMapAccessor


public interface IdentityMapAccessor

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:
Session

Method Summary
 void clearQueryCache()
          ADVANCED: Clear all the query caches
 void clearQueryCache(ReadQuery query)
          ADVANCED: Clear the query class associated with the passed-in read query.
 void clearQueryCache(java.lang.String sessionQueryName)
          ADVANCED: Clear the query cache associated with the named query on the session.
 void clearQueryCache(java.lang.String descriptorQueryName, java.lang.Class queryClass)
          ADVANCED: Clear the query cache associated with the named query on the descriptor for the given class.
 boolean containsObjectInIdentityMap(java.lang.Object domainObject)
          ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type of the given domainObject.
 boolean containsObjectInIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass)
          ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type as those specified.
 boolean containsObjectInIdentityMap(Record rowContainingPrimaryKey, java.lang.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.
 boolean containsObjectInIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)
          Deprecated. since EclipseLink 2.1, replaced by containsObjectInIdentityMap(Object, Class)
 java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy)
          ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.
 java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy, boolean shouldReturnInvalidatedObjects)
          ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.
 java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy)
          ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.
 java.util.Vector getAllFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy, boolean shouldReturnInvalidatedObjects)
          ADVANCED: Queries the cache in-memory with the passed in criteria and returns matching Objects.
 java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow)
          ADVANCED: Queries the cache in-memory and returns an Object from this identity map.
 java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, InMemoryQueryIndirectionPolicy valueHolderPolicy)
          ADVANCED: Queries the cache in-memory and returns an Object from this identity map.
 java.lang.Object getFromIdentityMap(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, int valueHolderPolicy)
          ADVANCED: Queries the cache in-memory and returns an Object from this identity map.
 java.lang.Object getFromIdentityMap(java.lang.Object domainObject)
          ADVANCED: Returns the Object from the identity map with the same primary key and Class type of the given domainObject.
 java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass)
          ADVANCED: Returns the Object from the identity map with the same primary key and Class type as those specified.
 java.lang.Object getFromIdentityMap(java.lang.Object primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)
          ADVANCED: Returns the Object from the identity map with the same primary key and Class type as specified.
 java.lang.Object getFromIdentityMap(Record rowContainingPrimaryKey, java.lang.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.
 java.lang.Object getFromIdentityMap(Record rowContainingPrimaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)
          ADVANCED: Returns the Object from the identity map with the same primary key of the specified row and Class type.
 java.lang.Object getFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass)
          Deprecated. since EclipseLink 2.1, replaced by getFromIdentityMap(Object, Class)
 java.lang.Object getFromIdentityMap(java.util.Vector primaryKey, java.lang.Class theClass, boolean shouldReturnInvalidatedObjects)
          Deprecated. since EclipseLink 2.1, replaced by getFromIdentityMap(Object, Class, boolean)
 long getRemainingValidTime(java.lang.Object object)
          ADVANCED: Returns the remaining life of the given Object.
 java.lang.Object getWriteLockValue(java.lang.Object domainObject)
          ADVANCED: Extracts and returns the write lock value from the identity map through the given Object.
 java.lang.Object getWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass)
          ADVANCED: Extracts the write lock value from the identity map through the passed in primaryKey and Class type.
 java.lang.Object getWriteLockValue(java.util.Vector primaryKey, java.lang.Class theClass)
          Deprecated. since EclipseLink 2.1, replaced by getWriteLockValue(Object, Class)
 void initializeAllIdentityMaps()
          PUBLIC: Resets the entire Object cache.
 void initializeIdentityMap(java.lang.Class theClass)
          PUBLIC: Resets the identity map for only the instances of the given Class type.
 void initializeIdentityMaps()
          PUBLIC: Resets the entire local Object cache.
 void invalidateAll()
          ADVANCED: Sets all of the Objects for all classes to be invalid in the cache.
 void invalidateClass(java.lang.Class theClass)
          ADVANCED: Sets all of the Objects of the specified Class type to be invalid in the cache.
 void invalidateClass(java.lang.Class theClass, boolean recurse)
          ADVANCED: Sets all of the Objects of the specified Class type to be invalid in the cache.
 void invalidateObject(java.lang.Object object)
          ADVANCED: Sets an Object to be invalid in the cache.
 void invalidateObject(java.lang.Object object, boolean invalidateCluster)
          ADVANCED: Set an object to be invalid in the cache.
 void invalidateObject(java.lang.Object primaryKey, java.lang.Class theClass)
          ADVANCED: Sets an Object with the specified primary key and Class type to be invalid in the cache.
 void invalidateObject(java.lang.Object primaryKey, java.lang.Class theClass, boolean invalidateCluster)
          ADVANCED: Set an object to be invalid in the cache.
 void invalidateObject(Record rowContainingPrimaryKey, java.lang.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.
 void invalidateObject(Record rowContainingPrimaryKey, java.lang.Class theClass, boolean invalidateCluster)
          ADVANCED: Set an object to be invalid in the cache.
 void invalidateObject(java.util.Vector primaryKey, java.lang.Class theClass)
          Deprecated. since EclipseLink 2.1, replaced by invalidateObject(Object, Class)
 void invalidateObject(java.util.Vector primaryKey, java.lang.Class theClass, boolean invalidateCluster)
          Deprecated. since EclipseLink 2.1, replaced by invalidateObject(Object, Class, boolean)
 void invalidateObjects(java.util.Collection collection)
          ADVANCED: Sets all of the Objects in the given collection to be invalid in the TopLink identity maps.
 void invalidateObjects(java.util.Collection collection, boolean invalidateCluster)
          ADVANCED: Set all of the objects in the given collection to be invalid in the cache.
 void invalidateObjects(Expression selectionCriteria)
          ADVANCED: Sets all of the Objects matching the given Expression to be invalid in the cache.
 void invalidateObjects(Expression selectionCriteria, java.lang.Class theClass, Record translationRow, boolean shouldInvalidateOnException)
          ADVANCED: Queries the cache in-memory with the passed in criteria and invalidates matching Objects.
 boolean isValid(java.lang.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.
 boolean isValid(java.lang.Object primaryKey, java.lang.Class theClass)
          ADVANCED: Returns true if the Object described by the given primary key and Class type is valid in the cache.
 boolean isValid(Record rowContainingPrimaryKey, java.lang.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.
 boolean isValid(java.util.Vector primaryKey, java.lang.Class theClass)
          Deprecated. since EclipseLink 2.1, replaced by isValid(Object, Class)
 void printIdentityMap(java.lang.Class theClass)
          PUBLIC: Used to print all the Objects in the identity map of the given Class type.
 void printIdentityMapLocks()
          PUBLIC: Used to print all the locks in every identity map in this session.
 void printIdentityMaps()
          PUBLIC: Used to print all the Objects in every identity map in this session.
 java.lang.Object putInIdentityMap(java.lang.Object domainObject)
          ADVANCED: Registers the given Object with the identity map.
 java.lang.Object putInIdentityMap(java.lang.Object domainObject, java.lang.Object key)
          ADVANCED: Registers the Object and given key with the identity map.
 java.lang.Object putInIdentityMap(java.lang.Object domainObject, java.lang.Object key, java.lang.Object writeLockValue)
          ADVANCED: Registers the Object and given key with the identity map.
 java.lang.Object putInIdentityMap(java.lang.Object domainObject, java.lang.Object key, java.lang.Object writeLockValue, long readTime)
          ADVANCED: Registers the given Object with the identity map.
 java.lang.Object putInIdentityMap(java.lang.Object domainObject, java.util.Vector key)
          Deprecated. since EclipseLink 2.1, replaced by putInIdentityMap(Object, Object)
 java.lang.Object putInIdentityMap(java.lang.Object domainObject, java.util.Vector key, java.lang.Object writeLockValue)
          Deprecated. since EclipseLink 2.1, replaced by putInIdentityMap(Object, Object, Object)
 java.lang.Object putInIdentityMap(java.lang.Object domainObject, java.util.Vector key, java.lang.Object writeLockValue, long readTime)
          Deprecated. since EclipseLink 2.1, replaced by putInIdentityMap(Object, Object, Object, long)
 java.lang.Object removeFromIdentityMap(java.lang.Object domainObject)
          ADVANCED: Removes the Object from the Object cache.
 java.lang.Object removeFromIdentityMap(java.lang.Object key, java.lang.Class theClass)
          ADVANCED: Removes the Object with given primary key and Class from the Object cache.
 java.lang.Object removeFromIdentityMap(java.util.Vector key, java.lang.Class theClass)
          Deprecated. since EclipseLink 2.1, replaced by removeFromIdentityMap(Object, Class)
 void updateWriteLockValue(java.lang.Object primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)
          ADVANCED: Updates the write lock value in the cache for the Object with same primary key as the given Object.
 void updateWriteLockValue(java.lang.Object domainObject, java.lang.Object writeLockValue)
          ADVANCED: Updates the write lock value in the identity map for cache key of the primary key the given Object.
 void updateWriteLockValue(java.util.Vector primaryKey, java.lang.Class theClass, java.lang.Object writeLockValue)
          Deprecated. since EclipseLink 2.1, replaced by updateWriteLockValue(Object, Class, Object)
 void validateCache()
          ADVANCED: This can be used to help debugging an Object identity problem.
 

Method Detail

clearQueryCache

void clearQueryCache()
ADVANCED: Clear all the query caches


clearQueryCache

void clearQueryCache(ReadQuery query)
ADVANCED: Clear the query class associated with the passed-in read query.


clearQueryCache

void clearQueryCache(java.lang.String sessionQueryName)
ADVANCED: Clear the query cache associated with the named query on the session.


clearQueryCache

void clearQueryCache(java.lang.String descriptorQueryName,
                     java.lang.Class queryClass)
ADVANCED: Clear the query cache associated with the named query on the descriptor for the given class.


containsObjectInIdentityMap

boolean containsObjectInIdentityMap(java.lang.Object domainObject)
ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type of the given domainObject.


containsObjectInIdentityMap

@Deprecated
boolean containsObjectInIdentityMap(java.util.Vector primaryKey,
                                               java.lang.Class theClass)
Deprecated. since EclipseLink 2.1, replaced by containsObjectInIdentityMap(Object, Class)

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

See Also:
containsObjectInIdentityMap(Object, Class)

containsObjectInIdentityMap

boolean containsObjectInIdentityMap(java.lang.Object primaryKey,
                                    java.lang.Class theClass)
ADVANCED: Returns true if the identity map contains an Object with the same primary key and Class type as those specified.


containsObjectInIdentityMap

boolean containsObjectInIdentityMap(Record rowContainingPrimaryKey,
                                    java.lang.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.


getAllFromIdentityMap

java.util.Vector getAllFromIdentityMap(Expression selectionCriteria,
                                       java.lang.Class theClass,
                                       Record 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 selecting the Objects to be returned
theClass - Class to be considered
translationRow - Record
valueHolderPolicy - see InMemoryQueryIndirectionPolicy
shouldReturnInvalidatedObjects - boolean - true if only invalid Objects should be returned
Returns:
Vector of Objects
Throws:
QueryException

getAllFromIdentityMap

java.util.Vector getAllFromIdentityMap(Expression selectionCriteria,
                                       java.lang.Class theClass,
                                       Record 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 selecting the Objects to be returned
theClass - Class to be considered
translationRow - Record
valueHolderPolicy - see InMemoryQueryIndirectionPolicy
shouldReturnInvalidatedObjects - boolean - true if only invalid Objects should be returned
Returns:
Vector of Objects
Throws:
QueryException

getAllFromIdentityMap

java.util.Vector getAllFromIdentityMap(Expression selectionCriteria,
                                       java.lang.Class theClass,
                                       Record 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 selecting the Objects to be returned
theClass - Class to be considered
translationRow - Record
valueHolderPolicy - see InMemoryQueryIndirectionPolicy
Returns:
Vector of Objects with type theClass and matching the selectionCriteria
Throws:
QueryException

getAllFromIdentityMap

java.util.Vector getAllFromIdentityMap(Expression selectionCriteria,
                                       java.lang.Class theClass,
                                       Record 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 selecting the Objects to be returned
theClass - Class to be considered
translationRow - Record
valueHolderPolicy - see InMemoryQueryIndirectionPolicy
Returns:
Vector of Objects with type theClass and matching the selectionCriteria
Throws:
QueryException

getFromIdentityMap

java.lang.Object getFromIdentityMap(java.lang.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
Returns:
Object from identity map, may be null.

getFromIdentityMap

@Deprecated
java.lang.Object getFromIdentityMap(java.util.Vector primaryKey,
                                               java.lang.Class theClass)
Deprecated. since EclipseLink 2.1, replaced by getFromIdentityMap(Object, Class)

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

Returns:
Object from identity map, may be null.
See Also:
getFromIdentityMap(Object, Class)

getFromIdentityMap

java.lang.Object getFromIdentityMap(java.lang.Object primaryKey,
                                    java.lang.Class theClass)
ADVANCED: Returns the Object from the identity map with the same primary key and Class type as those specified.

Returns:
Object from identity map, may be null.

getFromIdentityMap

java.lang.Object getFromIdentityMap(Record rowContainingPrimaryKey,
                                    java.lang.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 - Record
theClass - Class
Returns:
Object from identity map, may be null.

getFromIdentityMap

@Deprecated
java.lang.Object getFromIdentityMap(java.util.Vector primaryKey,
                                               java.lang.Class theClass,
                                               boolean shouldReturnInvalidatedObjects)
Deprecated. since EclipseLink 2.1, replaced by getFromIdentityMap(Object, Class, boolean)

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 from identity map, may be null.
See Also:
getFromIdentityMap(Object, Class, boolean)

getFromIdentityMap

java.lang.Object getFromIdentityMap(java.lang.Object primaryKey,
                                    java.lang.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 from identity map, may be null.

getFromIdentityMap

java.lang.Object getFromIdentityMap(Record rowContainingPrimaryKey,
                                    java.lang.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 - Record
theClass - Class
shouldReturnInvalidatedObjects - boolean
Returns:
Object from identity map, may be null.

getFromIdentityMap

java.lang.Object getFromIdentityMap(Expression selectionCriteria,
                                    java.lang.Class theClass,
                                    Record 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
theClass - Class
translationRow - Record
Returns:
Object from identity map, may be null
Throws:
QueryException

getFromIdentityMap

java.lang.Object getFromIdentityMap(Expression selectionCriteria,
                                    java.lang.Class theClass,
                                    Record 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
theClass - Class
translationRow - Record
valueHolderPolicy - see InMemoryQueryIndirectionPolicy
Returns:
Object from identity map, may be null
Throws:
QueryException

getFromIdentityMap

java.lang.Object getFromIdentityMap(Expression selectionCriteria,
                                    java.lang.Class theClass,
                                    Record 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
theClass - Class
translationRow - Record
valueHolderPolicy - see InMemoryQueryIndirectionPolicy
Returns:
Object from identity map, may be null
Throws:
QueryException

getRemainingValidTime

long getRemainingValidTime(java.lang.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 under consideration
Returns:
long time in milliseconds

getWriteLockValue

java.lang.Object getWriteLockValue(java.lang.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
Returns:
Object for versioning

getWriteLockValue

@Deprecated
java.lang.Object getWriteLockValue(java.util.Vector primaryKey,
                                              java.lang.Class theClass)
Deprecated. since EclipseLink 2.1, replaced by getWriteLockValue(Object, Class)

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.

See Also:
getWriteLockValue(Object, Class)

getWriteLockValue

java.lang.Object getWriteLockValue(java.lang.Object primaryKey,
                                   java.lang.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.


initializeAllIdentityMaps

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.


initializeIdentityMap

void initializeIdentityMap(java.lang.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

initializeIdentityMaps

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.


invalidateObject

void invalidateObject(java.lang.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

invalidateObject

void invalidateObject(java.lang.Object object,
                      boolean invalidateCluster)
ADVANCED: Set an object to be invalid in the cache.

Parameters:
invalidateCluster - if true the invalidation will be broadcast to each server in the cluster.

invalidateObject

@Deprecated
void invalidateObject(java.util.Vector primaryKey,
                                 java.lang.Class theClass)
Deprecated. since EclipseLink 2.1, replaced by invalidateObject(Object, Class)

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.

See Also:
invalidateObject(Object, Class)

invalidateObject

void invalidateObject(java.lang.Object primaryKey,
                      java.lang.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.


invalidateObject

@Deprecated
void invalidateObject(java.util.Vector primaryKey,
                                 java.lang.Class theClass,
                                 boolean invalidateCluster)
Deprecated. since EclipseLink 2.1, replaced by invalidateObject(Object, Class, boolean)

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

Parameters:
invalidateCluster - if true the invalidation will be broadcast to each server in the cluster.
See Also:
invalidateObject(Object, Class, boolean)

invalidateObject

void invalidateObject(java.lang.Object primaryKey,
                      java.lang.Class theClass,
                      boolean invalidateCluster)
ADVANCED: Set an object to be invalid in the cache.

Parameters:
invalidateCluster - if true the invalidation will be broadcast to each server in the cluster.

invalidateObject

void invalidateObject(Record rowContainingPrimaryKey,
                      java.lang.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.


invalidateObject

void invalidateObject(Record rowContainingPrimaryKey,
                      java.lang.Class theClass,
                      boolean invalidateCluster)
ADVANCED: Set an object to be invalid in the cache.

Parameters:
invalidateCluster - if true the invalidation will be broadcast to each server in the cluster.

invalidateObjects

void invalidateObjects(java.util.Collection 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 - objects to be invalidated

invalidateObjects

void invalidateObjects(java.util.Collection collection,
                       boolean invalidateCluster)
ADVANCED: Set all of the objects in the given collection to be invalid in the cache.

Parameters:
invalidateCluster - if true the invalidation will be broadcast to each server in the cluster.

invalidateObjects

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

invalidateObjects

void invalidateObjects(Expression selectionCriteria,
                       java.lang.Class theClass,
                       Record 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 selecting the Objects to be returned
theClass - Class to be considered
translationRow - Record
shouldInvalidateOnException - boolean indicates weather to invalidate the object if conform threw exception.

invalidateAll

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


invalidateClass

void invalidateClass(java.lang.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.


invalidateClass

void invalidateClass(java.lang.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
recurse - boolean

isValid

boolean isValid(java.lang.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.


isValid

@Deprecated
boolean isValid(java.util.Vector primaryKey,
                           java.lang.Class theClass)
Deprecated. since EclipseLink 2.1, replaced by isValid(Object, Class)

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

See Also:
isValid(Object, Class)

isValid

boolean isValid(java.lang.Object primaryKey,
                java.lang.Class theClass)
ADVANCED: Returns true if the Object described by the given primary key and Class type is valid in the cache.


isValid

boolean isValid(Record rowContainingPrimaryKey,
                java.lang.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.


printIdentityMap

void printIdentityMap(java.lang.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.


printIdentityMaps

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.


printIdentityMapLocks

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.


putInIdentityMap

java.lang.Object putInIdentityMap(java.lang.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
Returns:
Object

putInIdentityMap

@Deprecated
java.lang.Object putInIdentityMap(java.lang.Object domainObject,
                                             java.util.Vector key)
Deprecated. since EclipseLink 2.1, replaced by putInIdentityMap(Object, Object)

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.

See Also:
putInIdentityMap(Object, Object)

putInIdentityMap

java.lang.Object putInIdentityMap(java.lang.Object domainObject,
                                  java.lang.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.


putInIdentityMap

@Deprecated
java.lang.Object putInIdentityMap(java.lang.Object domainObject,
                                             java.util.Vector key,
                                             java.lang.Object writeLockValue)
Deprecated. since EclipseLink 2.1, replaced by putInIdentityMap(Object, Object, Object)

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.

See Also:
putInIdentityMap(Object, Object, Object)

putInIdentityMap

java.lang.Object putInIdentityMap(java.lang.Object domainObject,
                                  java.lang.Object key,
                                  java.lang.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.


putInIdentityMap

@Deprecated
java.lang.Object putInIdentityMap(java.lang.Object domainObject,
                                             java.util.Vector key,
                                             java.lang.Object writeLockValue,
                                             long readTime)
Deprecated. since EclipseLink 2.1, replaced by putInIdentityMap(Object, Object, Object, long)

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
key - Object
writeLockValue - Object for versioning
readTime - long, time in milliseconds
Returns:
Object the Object put into the identity map
See Also:
putInIdentityMap(Object, Object, Object, long)

putInIdentityMap

java.lang.Object putInIdentityMap(java.lang.Object domainObject,
                                  java.lang.Object key,
                                  java.lang.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
key - Object
writeLockValue - Object for versioning
readTime - long, time in milliseconds
Returns:
Object the Object put into the identity map

removeFromIdentityMap

java.lang.Object removeFromIdentityMap(java.lang.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
Returns:
Object the Object removed from the identity map

removeFromIdentityMap

@Deprecated
java.lang.Object removeFromIdentityMap(java.util.Vector key,
                                                  java.lang.Class theClass)
Deprecated. since EclipseLink 2.1, replaced by removeFromIdentityMap(Object, Class)

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 the Object removed from the identity map
See Also:
removeFromIdentityMap(Object, Class)

removeFromIdentityMap

java.lang.Object removeFromIdentityMap(java.lang.Object key,
                                       java.lang.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 the Object removed from the identity map

updateWriteLockValue

void updateWriteLockValue(java.lang.Object domainObject,
                          java.lang.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
writeLockValue - Object for versioning

updateWriteLockValue

@Deprecated
void updateWriteLockValue(java.util.Vector primaryKey,
                                     java.lang.Class theClass,
                                     java.lang.Object writeLockValue)
Deprecated. since EclipseLink 2.1, replaced by updateWriteLockValue(Object, Class, Object)

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.

See Also:
updateWriteLockValue(Object, Class, Object)

updateWriteLockValue

void updateWriteLockValue(java.lang.Object primaryKey,
                          java.lang.Class theClass,
                          java.lang.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.


validateCache

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.


EclipseLink 2.4.2, build 'v20130514-5956486' API Reference