public class StandardCacheEntryImpl extends Object implements CacheEntry
Standard representation of entity cached data using the "disassembled state".
| Constructor and Description |
|---|
StandardCacheEntryImpl(Object[] state,
EntityPersister persister,
Object version,
SharedSessionContractImplementor session,
Object owner)
Constructs a StandardCacheEntryImpl
|
| Modifier and Type | Method and Description |
|---|---|
Object[] |
assemble(Object instance,
Serializable id,
EntityPersister persister,
Interceptor interceptor,
EventSource session)
Assemble the previously disassembled state represented by this entry into the given entity instance.
|
Serializable[] |
getDisassembledState()
Get the underlying disassembled state
|
String |
getSubclass()
Hibernate stores all entries pertaining to a given entity hierarchy in a single region.
|
Object |
getVersion()
Retrieves the version (optimistic locking) associated with this cache entry.
|
boolean |
isDeepCopyNeeded()
After assembly, is a copy of the array needed?
|
boolean |
isReferenceEntry()
Does this entry represent a direct entity reference (rather than disassembled state)?
|
String |
toString() |
public StandardCacheEntryImpl(Object[] state, EntityPersister persister, Object version, SharedSessionContractImplementor session, Object owner) throws HibernateException
Constructs a StandardCacheEntryImpl
state - The extracted statepersister - The entity persisterversion - The current version (if versioned)session - The originating sessionowner - The ownerHibernateException - Generally indicates a problem performing the dis-assembly.public boolean isReferenceEntry()
CacheEntryDoes this entry represent a direct entity reference (rather than disassembled state)?
isReferenceEntry in interface CacheEntrypublic Serializable[] getDisassembledState()
CacheEntryGet 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 a EntityEntry based on this state for return.
getDisassembledState in interface CacheEntrypublic String getSubclass()
CacheEntryHibernate 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.
getSubclass in interface CacheEntrypublic Object getVersion()
CacheEntryRetrieves the version (optimistic locking) associated with this cache entry.
getVersion in interface CacheEntrypublic boolean isDeepCopyNeeded()
After assembly, is a copy of the array needed?
public Object[] assemble(Object instance, Serializable id, EntityPersister persister, Interceptor interceptor, EventSource session) throws HibernateException
Assemble the previously disassembled state represented by this entry into the given entity instance.
Additionally manages the PreLoadEvent callbacks.
instance - The entity instanceid - The entity identifierpersister - The entity persisterinterceptor - (currently unused)session - The sessionHibernateException - Indicates a problem performing assembly or calling the PreLoadEventListeners.Type.assemble(java.io.Serializable, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object),
Type.disassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.