ORMEvictCollection()

edit

Evicts all cached entries for the specified collection/relationship on the given entity from the second-level cache.

Requires Extension: Hibernate ORM Engine Extension

ORMEvictCollection( entityName=String, collectionName=String, primaryKey=String );

Returns: void

Argument Description
entityName
String, required
edit

Entity name

collectionName
String, required
edit

Name of the collection in the component

primaryKey
String, optional
edit

Primary key of the collection or association data of the entity

Usage Notes

edit

Evicts a cached relationship collection from the second-level (L2) cache. The collectionName is the property name of the relationship on the owning entity.

If primaryKey is provided, only the collection for that specific entity instance is evicted. Otherwise all cached collections of that relationship are evicted.

Only relevant when secondaryCacheEnabled is true and the relationship has cacheuse set.

See ORM - Caching for L2 cache details.

Examples

edit
// Evict all cached "items" collections on Category
ORMEvictCollection( "Category", "items" );

// Evict the collection for a specific Category instance ORMEvictCollection( "Category", "items", "cat-123" );

See also