Package org.hibernate.cache.spi.entry
Class ReferenceCacheEntryImpl
java.lang.Object
org.hibernate.cache.spi.entry.ReferenceCacheEntryImpl
- All Implemented Interfaces:
Serializable
,CacheEntry
Specialized CacheEntry for storing direct references to entity instances.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceCacheEntryImpl
(Object reference, EntityPersister subclassPersister) Constructs a ReferenceCacheEntryImpl -
Method Summary
Modifier and TypeMethodDescriptionGet the underlying disassembled state todo : this was added to support initializing an entity's EntityEntry snapshot during reattach; this should be refactored to instead expose a method to assemble an EntityEntry based on this state for return.Provides access to the stored reference.Hibernate stores all entries pertaining to a given entity hierarchy in a single region.Retrieves the version (optimistic locking) associated with this cache entry.boolean
Does this entry represent a direct entity reference (rather than disassembled state)?
-
Constructor Details
-
ReferenceCacheEntryImpl
Constructs a ReferenceCacheEntryImpl- Parameters:
reference
- The reference entity instancesubclassPersister
- The specific subclass persister
-
-
Method Details
-
getReference
Provides access to the stored reference.- Returns:
- The stored reference
-
isReferenceEntry
public boolean isReferenceEntry()Description copied from interface:CacheEntry
Does this entry represent a direct entity reference (rather than disassembled state)?- Specified by:
isReferenceEntry
in interfaceCacheEntry
- Returns:
- true/false
-
getSubclass
Description copied from interface:CacheEntry
Hibernate stores all entries pertaining to a given entity hierarchy in a single region. This attribute tells us the specific entity type represented by the cached data.- Specified by:
getSubclass
in interfaceCacheEntry
- Returns:
- The entry's exact entity type.
-
getSubclassPersister
-
getVersion
Description copied from interface:CacheEntry
Retrieves the version (optimistic locking) associated with this cache entry.- Specified by:
getVersion
in interfaceCacheEntry
- Returns:
- The version of the entity represented by this entry
-
getDisassembledState
Description copied from interface:CacheEntry
Get the underlying disassembled state todo : this was added to support initializing an entity's EntityEntry snapshot during reattach; this should be refactored to instead expose a method to assemble an EntityEntry based on this state for return.- Specified by:
getDisassembledState
in interfaceCacheEntry
- Returns:
- The disassembled state
-