Class StandardCacheEntryImpl

  • All Implemented Interfaces:
    java.io.Serializable, CacheEntry

    public class StandardCacheEntryImpl
    extends java.lang.Object
    implements CacheEntry
    Standard representation of entity cached data using the "disassembled state".
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] assemble​(java.lang.Object instance, java.io.Serializable id, EntityPersister persister, Interceptor interceptor, EventSource session)
      Assemble the previously disassembled state represented by this entry into the given entity instance.
      java.io.Serializable[] getDisassembledState()
      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 a EntityEntry based on this state for return.
      java.lang.String getSubclass()
      Hibernate stores all entries pertaining to a given entity hierarchy in a single region.
      java.lang.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)?
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StandardCacheEntryImpl

        public StandardCacheEntryImpl​(java.lang.Object[] state,
                                      EntityPersister persister,
                                      java.lang.Object version,
                                      SharedSessionContractImplementor session,
                                      java.lang.Object owner)
                               throws HibernateException
        Constructs a StandardCacheEntryImpl
        Parameters:
        state - The extracted state
        persister - The entity persister
        version - The current version (if versioned)
        session - The originating session
        owner - The owner
        Throws:
        HibernateException - Generally indicates a problem performing the dis-assembly.
    • Method Detail

      • 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 interface CacheEntry
        Returns:
        true/false
      • getDisassembledState

        public java.io.Serializable[] 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 a EntityEntry based on this state for return.
        Specified by:
        getDisassembledState in interface CacheEntry
        Returns:
        The disassembled state
      • getSubclass

        public java.lang.String 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 interface CacheEntry
        Returns:
        The entry's exact entity type.
      • getVersion

        public java.lang.Object getVersion()
        Description copied from interface: CacheEntry
        Retrieves the version (optimistic locking) associated with this cache entry.
        Specified by:
        getVersion in interface CacheEntry
        Returns:
        The version of the entity represented by this entry
      • isDeepCopyNeeded

        public boolean isDeepCopyNeeded()
        After assembly, is a copy of the array needed?
        Returns:
        true/false
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object