Top Description Fields Constructors Methods
org.hibernate.cache.spi.entry

public Class StandardCacheEntryImpl

extends Object
implements CacheEntry
Class Inheritance
All Implemented Interfaces
org.hibernate.cache.spi.entry.CacheEntry, java.io.Serializable
Imports
java.io.Serializable, org.hibernate.AssertionFailure, .HibernateException, .Interceptor, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.event.service.spi.EventListenerGroup, .EventListenerRegistry, org.hibernate.event.spi.EventSource, .EventType, .PreLoadEvent, .PreLoadEventListener, org.hibernate.persister.entity.EntityPersister, org.hibernate.type.TypeHelper

Standard representation of entity cached data using the "disassembled state".
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final Serializable[]
private final String
private final Object

Constructor Summary

AccessConstructor and Description
public
StandardCacheEntryImpl(final Object[]
The extracted state
state
,
final EntityPersister
The entity persister
persister
,
final Object
The current version (if versioned)
version
,
final SharedSessionContractImplementor
The originating session
session
,
final Object
The owner
owner
)

Constructs a StandardCacheEntryImpl

pack-priv
StandardCacheEntryImpl(Serializable[] disassembledState, String subclass, Object version)

Method Summary

Modifier and TypeMethod and Description
public Object[]

Returns:

The assembled state
assemble
(final Object
The entity instance
instance
,
final Serializable
The entity identifier
id
,
final EntityPersister
The entity persister
persister
,
final Interceptor
(currently unused)
interceptor
,
final EventSource
The session
session
)

Deprecated as a consequence of EventSource being deprecated.
Assemble the previously disassembled state represented by this entry into the given entity instance.
public Serializable[]
getDisassembledState()

Implements org.hibernate.cache.spi.entry.CacheEntry.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 an EntityEntry based on this state for return.
public String
getSubclass()

Implements org.hibernate.cache.spi.entry.CacheEntry.getSubclass.

Hibernate stores all entries pertaining to a given entity hierarchy in a single region.
public Object
getVersion()

Implements org.hibernate.cache.spi.entry.CacheEntry.getVersion.

Retrieves the version (optimistic locking) associated with this cache entry.
public boolean

Returns:

true/false
isDeepCopyNeeded
()

After assembly, is a copy of the array needed?

public boolean
isReferenceEntry()

Implements org.hibernate.cache.spi.entry.CacheEntry.isReferenceEntry.

Does this entry represent a direct entity reference (rather than disassembled state)?
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

disassembledStateback to summary
private final Serializable[] disassembledState
subclassback to summary
private final String subclass
versionback to summary
private final Object version

Constructor Detail

StandardCacheEntryImplback to summary
public StandardCacheEntryImpl(final Object[] state, final EntityPersister persister, final Object version, final SharedSessionContractImplementor session, final Object owner) throws HibernateException

Constructs a StandardCacheEntryImpl

Parameters
state:Object[]

The extracted state

persister:EntityPersister

The entity persister

version:Object

The current version (if versioned)

session:SharedSessionContractImplementor

The originating session

owner:Object

The owner

Exceptions
HibernateException:
Generally indicates a problem performing the dis-assembly.
StandardCacheEntryImplback to summary
pack-priv StandardCacheEntryImpl(Serializable[] disassembledState, String subclass, Object version)

Method Detail

assembleback to summary
public Object[] assemble(final Object instance, final Serializable id, final EntityPersister persister, final Interceptor interceptor, final EventSource session) throws HibernateException

Deprecated

as a consequence of EventSource being deprecated. See corresponding docs for further information.

Assemble the previously disassembled state represented by this entry into the given entity instance. Additionally manages the PreLoadEvent callbacks.

Parameters
instance:Object

The entity instance

id:Serializable

The entity identifier

persister:EntityPersister

The entity persister

interceptor:Interceptor

(currently unused)

session:EventSource

The session

Returns:Object[]

The assembled state

Exceptions
HibernateException:
Indicates a problem performing assembly or calling the PreLoadEventListeners.
See Also
org.hibernate.type.Type#assemble, org.hibernate.type.Type#disassemble
getDisassembledStateback to summary
public Serializable[] getDisassembledState()

Implements org.hibernate.cache.spi.entry.CacheEntry.getDisassembledState.

Doc from org.hibernate.cache.spi.entry.CacheEntry.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 an EntityEntry based on this state for return.

Returns:Serializable[]

The disassembled state

Annotations
@Override
getSubclassback to summary
public String getSubclass()

Implements org.hibernate.cache.spi.entry.CacheEntry.getSubclass.

Doc from org.hibernate.cache.spi.entry.CacheEntry.getSubclass.

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.

Returns:String

The entry's exact entity type.

Annotations
@Override
getVersionback to summary
public Object getVersion()

Implements org.hibernate.cache.spi.entry.CacheEntry.getVersion.

Doc from org.hibernate.cache.spi.entry.CacheEntry.getVersion.

Retrieves the version (optimistic locking) associated with this cache entry.

Returns:Object

The version of the entity represented by this entry

Annotations
@Override
isDeepCopyNeededback to summary
public boolean isDeepCopyNeeded()

After assembly, is a copy of the array needed?

Returns:boolean

true/false

isReferenceEntryback to summary
public boolean isReferenceEntry()

Implements org.hibernate.cache.spi.entry.CacheEntry.isReferenceEntry.

Doc from org.hibernate.cache.spi.entry.CacheEntry.isReferenceEntry.

Does this entry represent a direct entity reference (rather than disassembled state)?

Returns:boolean

true/false

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override