public class StatefulPersistenceContext extends java.lang.Object implements PersistenceContext
PersistenceContext
contract meaning that we maintain this
state throughout the life of the persistence context.
IMPL NOTE: There is meant to be a one-to-one correspondence between a SessionImpl
and a PersistentContext. Event listeners and other Session collaborators then use the PersistentContext to drive
their processing.PersistenceContext.NaturalIdHelper
NO_ROW
Constructor and Description |
---|
StatefulPersistenceContext(SessionImplementor session)
Constructs a PersistentContext, bound to the given session.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildParent(java.lang.Object child,
java.lang.Object parent)
Add a child/parent relation to cache for cascading op
|
void |
addCollectionHolder(PersistentCollection holder)
Register a PersistentCollection object for an array.
|
void |
addEntity(EntityKey key,
java.lang.Object entity)
Add a canonical mapping from entity key to entity instance
|
void |
addEntity(EntityUniqueKey euk,
java.lang.Object entity)
Add an entity to the cache by unique key
|
EntityEntry |
addEntity(java.lang.Object entity,
Status status,
java.lang.Object[] loadedState,
EntityKey entityKey,
java.lang.Object version,
LockMode lockMode,
boolean existsInDatabase,
EntityPersister persister,
boolean disableVersionIncrement)
Adds an entity to the internal caches.
|
EntityEntry |
addEntry(java.lang.Object entity,
Status status,
java.lang.Object[] loadedState,
java.lang.Object rowId,
java.io.Serializable id,
java.lang.Object version,
LockMode lockMode,
boolean existsInDatabase,
EntityPersister persister,
boolean disableVersionIncrement)
Generates an appropriate EntityEntry instance and adds it
to the event source's internal caches.
|
CollectionEntry |
addInitializedCollection(CollectionPersister persister,
PersistentCollection collection,
java.io.Serializable id)
add a collection we just pulled out of the cache (does not need initializing)
|
void |
addInitializedDetachedCollection(CollectionPersister collectionPersister,
PersistentCollection collection)
add an (initialized) collection that was created by another session and passed
into update() (ie.
|
void |
addNewCollection(CollectionPersister persister,
PersistentCollection collection)
Add a new collection (ie.
|
void |
addNonLazyCollection(PersistentCollection collection)
Register a collection for non-lazy loading at the end of the
two-phase load
|
void |
addNullProperty(EntityKey ownerKey,
java.lang.String propertyName)
Record the fact that the association belonging to the keyed
entity is null.
|
void |
addProxy(EntityKey key,
java.lang.Object proxy)
Add a proxy to the session cache
|
EntityEntry |
addReferenceEntry(java.lang.Object entity,
Status status) |
void |
addUninitializedCollection(CollectionPersister persister,
PersistentCollection collection,
java.io.Serializable id)
add a collection we just loaded up (still needs initializing)
|
void |
addUninitializedDetachedCollection(CollectionPersister persister,
PersistentCollection collection)
add a detached uninitialized collection
|
void |
addUnownedCollection(CollectionKey key,
PersistentCollection collection)
Add a collection which has no owner loaded
|
void |
afterLoad()
Call this after finishing a two-phase load
|
void |
afterTransactionCompletion()
Called after transactions end
|
void |
beforeLoad()
Call this before beginning a two-phase load
|
void |
beginRemoveOrphanBeforeUpdates() |
void |
checkUniqueness(EntityKey key,
java.lang.Object object)
Attempts to check whether the given key represents an entity already loaded within the
current session.
|
void |
clear()
Clear the state of the persistence context
|
boolean |
containsCollection(PersistentCollection collection)
Is the given collection associated with this persistence context?
|
boolean |
containsEntity(EntityKey key)
Is there an entity with the given key in the persistence context
|
boolean |
containsProxy(java.lang.Object entity)
Is the given proxy associated with this persistence context?
|
int |
decrementCascadeLevel()
Called after cascading
|
static StatefulPersistenceContext |
deserialize(java.io.ObjectInputStream ois,
SessionImplementor session)
Used by the owning session to explicitly control deserialization of the persistence context.
|
void |
endRemoveOrphanBeforeUpdates() |
BatchFetchQueue |
getBatchFetchQueue()
Get the
BatchFetchQueue , instantiating one if necessary. |
java.lang.Object[] |
getCachedDatabaseSnapshot(EntityKey key)
Retrieve the cached database snapshot for the requested entity key.
|
int |
getCascadeLevel()
How deep are we cascaded?
|
PersistentCollection |
getCollection(CollectionKey collectionKey)
Get the collection instance associated with the CollectionKey
|
java.util.Map |
getCollectionEntries()
Get the mapping from collection instance to collection entry
|
CollectionEntry |
getCollectionEntry(PersistentCollection coll)
Get the collection entry for a persistent collection
|
CollectionEntry |
getCollectionEntryOrNull(java.lang.Object collection)
Get the collection entry for a collection passed to filter,
which might be a collection wrapper, an array, or an unwrapped
collection.
|
PersistentCollection |
getCollectionHolder(java.lang.Object array)
Get the PersistentCollection object for an array
|
java.lang.Object |
getCollectionOwner(java.io.Serializable key,
CollectionPersister collectionPersister)
Get the entity that owns this persistent collection
|
java.util.Map |
getCollectionsByKey()
Get the mapping from collection key to collection instance
|
java.lang.Object[] |
getDatabaseSnapshot(java.io.Serializable id,
EntityPersister persister)
Get the current state of the entity as known to the underlying
database, or null if there is no corresponding row
Get the current state of the entity as known to the underlying database, or null if there is no
corresponding row
|
java.util.Map |
getEntitiesByKey()
Get the mapping from key value to entity instance
|
java.lang.Object |
getEntity(EntityKey key)
Get the entity instance associated with the given key
|
java.lang.Object |
getEntity(EntityUniqueKey euk)
Get an entity cached by unique key
|
java.util.Map |
getEntityEntries()
Get the mapping from entity instance to entity entry
|
EntityEntry |
getEntry(java.lang.Object entity)
Retrieve the
EntityEntry representation of the given entity. |
java.lang.Object |
getIndexInOwner(java.lang.String entity,
java.lang.String property,
java.lang.Object childEntity,
java.util.Map mergeMap)
Search the persistence context for an index of the child object,
given a collection role
|
LoadContexts |
getLoadContexts()
Retrieve this persistence context's managed load context.
|
java.io.Serializable |
getLoadedCollectionOwnerIdOrNull(PersistentCollection collection)
Get the ID for the entity that owned this persistent collection when it was loaded
|
java.lang.Object |
getLoadedCollectionOwnerOrNull(PersistentCollection collection)
Get the entity that owned this persistent collection when it was loaded
|
PersistenceContext.NaturalIdHelper |
getNaturalIdHelper()
Access to the natural-id helper for this persistence context
|
java.lang.Object[] |
getNaturalIdSnapshot(java.io.Serializable id,
EntityPersister persister)
Get the values of the natural id fields as known to the underlying database, or null if the entity has no
natural id or there is no corresponding row.
|
java.util.HashSet |
getNullifiableEntityKeys()
Retrieve the set of EntityKeys representing nullifiable references
|
int |
getNumberOfManagedEntities() |
java.io.Serializable |
getOwnerId(java.lang.String entityName,
java.lang.String propertyName,
java.lang.Object childEntity,
java.util.Map mergeMap)
Search this persistence context for an associated entity instance which is considered the "owner" of
the given childEntity, and return that owner's id value.
|
java.util.Map |
getProxiesByKey() |
java.lang.Object |
getProxy(EntityKey key)
Get an existing proxy by key
|
SessionImplementor |
getSession()
Get the session to which this persistence context is bound.
|
java.io.Serializable |
getSnapshot(PersistentCollection coll)
Get the snapshot of the pre-flush collection state
|
boolean |
hasNonReadOnlyEntities() |
int |
incrementCascadeLevel()
Called before cascading
|
void |
initializeNonLazyCollections()
Force initialization of all non-lazy collections encountered during
the current two-phase load (actually, this is a no-op, unless this
is the "outermost" load)
|
boolean |
isDefaultReadOnly()
Will entities and proxies that are loaded into this persistence
context be made read-only by default?
To determine the read-only/modifiable setting for a particular entity
or proxy:
|
boolean |
isEntryFor(java.lang.Object entity)
Is there an
EntityEntry registration for this entity instance? |
boolean |
isFlushing()
Is a flush cycle currently in process?
|
boolean |
isLoadFinished()
Is in a two-phase load?
|
boolean |
isPropertyNull(EntityKey ownerKey,
java.lang.String propertyName)
Is the association property belonging to the keyed entity null?
|
boolean |
isReadOnly(java.lang.Object entityOrProxy)
Is the entity or proxy read-only?
To determine the default read-only/modifiable setting used for entities and proxies that are loaded into the
session use
Session.isDefaultReadOnly() |
boolean |
isRemovingOrphanBeforeUpates() |
boolean |
isStateless() |
java.lang.Object |
narrowProxy(java.lang.Object proxy,
EntityPersister persister,
EntityKey key,
java.lang.Object object)
If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy
and overwrite the registration of the old one.
|
java.lang.Object |
proxyFor(EntityPersister persister,
EntityKey key,
java.lang.Object impl)
Return the existing proxy associated with the given EntityKey, or the
third argument (the entity associated with the key) if no proxy exists.
|
java.lang.Object |
proxyFor(java.lang.Object impl)
Return the existing proxy associated with the given EntityKey, or the
argument (the entity associated with the key) if no proxy exists.
|
boolean |
reassociateIfUninitializedProxy(java.lang.Object value)
Takes the given object and, if it represents a proxy, reassociates it with this event source.
|
void |
reassociateProxy(java.lang.Object value,
java.io.Serializable id)
If a deleted entity instance is re-saved, and it has a proxy, we need to
reset the identifier of the proxy
|
java.util.Map.Entry<java.lang.Object,EntityEntry>[] |
reentrantSafeEntityEntries()
Provides access to the entity/EntityEntry combos associated with the persistence context in a manner that
is safe from reentrant access.
|
void |
registerInsertedKey(EntityPersister persister,
java.io.Serializable id)
Register keys inserted during the current transaction
|
void |
removeChildParent(java.lang.Object child)
Remove child/parent relation from cache
|
PersistentCollection |
removeCollectionHolder(java.lang.Object array)
Remove the mapping of collection to holder during eviction
of the owning entity
|
java.lang.Object |
removeEntity(EntityKey key)
Remove an entity.
|
EntityEntry |
removeEntry(java.lang.Object entity)
Remove an entity entry from the session cache
|
java.lang.Object |
removeProxy(EntityKey key)
Remove a proxy from the session cache.
|
void |
replaceDelayedEntityIdentityInsertKeys(EntityKey oldKey,
java.io.Serializable generatedId) |
void |
serialize(java.io.ObjectOutputStream oos)
Used by the owning session to explicitly control serialization of the
persistence context.
|
void |
setDefaultReadOnly(boolean defaultReadOnly)
Change the default for entities and proxies loaded into this persistence
context from modifiable to read-only mode, or from modifiable to read-only
mode.
|
void |
setEntryStatus(EntityEntry entry,
Status status)
Set the status of an entry
|
void |
setFlushing(boolean flushing)
Called before and after the flushcycle
|
void |
setReadOnly(java.lang.Object object,
boolean readOnly)
Set an unmodified persistent object to read-only mode, or a read-only
object to modifiable mode.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
java.lang.Object |
unproxy(java.lang.Object maybeProxy)
Get the entity instance underlying the given proxy, throwing
an exception if the proxy is uninitialized.
|
java.lang.Object |
unproxyAndReassociate(java.lang.Object maybeProxy)
Possibly unproxy the given reference and reassociate it with the current session.
|
PersistentCollection |
useUnownedCollection(CollectionKey key)
Take ownership of a previously unowned collection, if one.
|
boolean |
wasInsertedDuringTransaction(EntityPersister persister,
java.io.Serializable id)
Allows callers to check to see if the identified entity was inserted during the current transaction.
|
public StatefulPersistenceContext(SessionImplementor session)
session
- The session "owning" this context.public boolean isStateless()
isStateless
in interface PersistenceContext
public SessionImplementor getSession()
PersistenceContext
getSession
in interface PersistenceContext
public LoadContexts getLoadContexts()
PersistenceContext
getLoadContexts
in interface PersistenceContext
public void addUnownedCollection(CollectionKey key, PersistentCollection collection)
PersistenceContext
addUnownedCollection
in interface PersistenceContext
key
- The collection key under which to add the collectioncollection
- The collection to addpublic PersistentCollection useUnownedCollection(CollectionKey key)
PersistenceContext
null
if no such
collection was previous added () or was previously removed.
This should indicate the owner is being loaded and we are ready to "link" them.useUnownedCollection
in interface PersistenceContext
key
- The collection key for which to locate a collection collectionnull
public BatchFetchQueue getBatchFetchQueue()
PersistenceContext
BatchFetchQueue
, instantiating one if necessary.getBatchFetchQueue
in interface PersistenceContext
public void clear()
PersistenceContext
clear
in interface PersistenceContext
public boolean isDefaultReadOnly()
PersistenceContext
isDefaultReadOnly
in interface PersistenceContext
PersistenceContext.isReadOnly(Object)
,
Session.isReadOnly(Object)
,
Session.isDefaultReadOnly()
public void setDefaultReadOnly(boolean defaultReadOnly)
PersistenceContext
setDefaultReadOnly
in interface PersistenceContext
defaultReadOnly
- true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiableTo override this session's read-only/modifiable setting for entities
and proxies loaded by a Query:
,
Query.setReadOnly(boolean)
,
Session.setDefaultReadOnly(boolean)
public boolean hasNonReadOnlyEntities()
hasNonReadOnlyEntities
in interface PersistenceContext
public void setEntryStatus(EntityEntry entry, Status status)
PersistenceContext
setEntryStatus
in interface PersistenceContext
entry
- The entry for which to set the statusstatus
- The new statuspublic void afterTransactionCompletion()
PersistenceContext
afterTransactionCompletion
in interface PersistenceContext
public java.lang.Object[] getDatabaseSnapshot(java.io.Serializable id, EntityPersister persister) throws HibernateException
getDatabaseSnapshot
in interface PersistenceContext
id
- The identifier of the entity for which to grab a snapshotpersister
- The persister of the entity.HibernateException
PersistenceContext.getCachedDatabaseSnapshot(org.hibernate.engine.spi.EntityKey)
public java.lang.Object[] getNaturalIdSnapshot(java.io.Serializable id, EntityPersister persister) throws HibernateException
PersistenceContext
getNaturalIdSnapshot
in interface PersistenceContext
id
- The identifier of the entity for which to grab a snapshotpersister
- The persister of the entity.HibernateException
public java.lang.Object[] getCachedDatabaseSnapshot(EntityKey key)
PersistenceContext
PersistenceContext.getDatabaseSnapshot(java.io.Serializable, org.hibernate.persister.entity.EntityPersister)
is two important respects:PersistenceContext.NO_ROW
here is interpretet as an exceptiongetCachedDatabaseSnapshot
in interface PersistenceContext
key
- The entity key for which to retrieve the cached snapshotpublic void addEntity(EntityKey key, java.lang.Object entity)
PersistenceContext
addEntity
in interface PersistenceContext
key
- The key under which to add an entityentity
- The entity instance to addpublic java.lang.Object getEntity(EntityKey key)
PersistenceContext
getEntity
in interface PersistenceContext
key
- The key under which to look for an entitynull
public boolean containsEntity(EntityKey key)
PersistenceContext
containsEntity
in interface PersistenceContext
key
- The key under which to look for an entitytrue
indicates an entity was found; otherwise false
public java.lang.Object removeEntity(EntityKey key)
PersistenceContext
EntityEntry
removeEntity
in interface PersistenceContext
key
- The key whose matching entity should be removedpublic java.lang.Object getEntity(EntityUniqueKey euk)
PersistenceContext
getEntity
in interface PersistenceContext
euk
- The unique (non-primary) key under which to look for an entitypublic void addEntity(EntityUniqueKey euk, java.lang.Object entity)
PersistenceContext
addEntity
in interface PersistenceContext
euk
- The unique (non-primary) key under which to add an entityentity
- The entity instancepublic EntityEntry getEntry(java.lang.Object entity)
PersistenceContext
EntityEntry
representation of the given entity.getEntry
in interface PersistenceContext
entity
- The entity instance for which to locate the corresponding entrypublic EntityEntry removeEntry(java.lang.Object entity)
PersistenceContext
removeEntry
in interface PersistenceContext
entity
- The entity instance for which to remove the corresponding entrypublic boolean isEntryFor(java.lang.Object entity)
PersistenceContext
EntityEntry
registration for this entity instance?isEntryFor
in interface PersistenceContext
entity
- The entity instance for which to check for an entrytrue
indicates a matching entry was found.public CollectionEntry getCollectionEntry(PersistentCollection coll)
PersistenceContext
getCollectionEntry
in interface PersistenceContext
coll
- The persistent collection instance for which to locate the collection entrypublic EntityEntry addEntity(java.lang.Object entity, Status status, java.lang.Object[] loadedState, EntityKey entityKey, java.lang.Object version, LockMode lockMode, boolean existsInDatabase, EntityPersister persister, boolean disableVersionIncrement)
PersistenceContext
addEntity
in interface PersistenceContext
public EntityEntry addEntry(java.lang.Object entity, Status status, java.lang.Object[] loadedState, java.lang.Object rowId, java.io.Serializable id, java.lang.Object version, LockMode lockMode, boolean existsInDatabase, EntityPersister persister, boolean disableVersionIncrement)
PersistenceContext
addEntry
in interface PersistenceContext
public EntityEntry addReferenceEntry(java.lang.Object entity, Status status)
public boolean containsCollection(PersistentCollection collection)
PersistenceContext
containsCollection
in interface PersistenceContext
public boolean containsProxy(java.lang.Object entity)
PersistenceContext
containsProxy
in interface PersistenceContext
public boolean reassociateIfUninitializedProxy(java.lang.Object value) throws MappingException
PersistenceContext
reassociateIfUninitializedProxy
in interface PersistenceContext
value
- The possible proxy to be reassociated.MappingException
public void reassociateProxy(java.lang.Object value, java.io.Serializable id) throws MappingException
PersistenceContext
reassociateProxy
in interface PersistenceContext
MappingException
public java.lang.Object unproxy(java.lang.Object maybeProxy) throws HibernateException
PersistenceContext
unproxy
in interface PersistenceContext
HibernateException
public java.lang.Object unproxyAndReassociate(java.lang.Object maybeProxy) throws HibernateException
PersistenceContext
unproxyAndReassociate
in interface PersistenceContext
maybeProxy
- The reference to be unproxied if it currently represents a proxy.HibernateException
public void checkUniqueness(EntityKey key, java.lang.Object object) throws HibernateException
PersistenceContext
checkUniqueness
in interface PersistenceContext
object
- The entity reference against which to perform the uniqueness check.HibernateException
public java.lang.Object narrowProxy(java.lang.Object proxy, EntityPersister persister, EntityKey key, java.lang.Object object) throws HibernateException
PersistenceContext
narrowProxy
in interface PersistenceContext
proxy
- The proxy instance to be narrowed.persister
- The persister for the proxied entity.key
- The internal cache key for the proxied entity.object
- (optional) the actual proxied entity instance.HibernateException
public java.lang.Object proxyFor(EntityPersister persister, EntityKey key, java.lang.Object impl) throws HibernateException
PersistenceContext
proxyFor
in interface PersistenceContext
HibernateException
public java.lang.Object proxyFor(java.lang.Object impl) throws HibernateException
PersistenceContext
proxyFor
in interface PersistenceContext
HibernateException
public java.lang.Object getCollectionOwner(java.io.Serializable key, CollectionPersister collectionPersister) throws MappingException
PersistenceContext
getCollectionOwner
in interface PersistenceContext
MappingException
public java.lang.Object getLoadedCollectionOwnerOrNull(PersistentCollection collection)
PersistenceContext
getLoadedCollectionOwnerOrNull
in interface PersistenceContext
collection
- The persistent collectionpublic java.io.Serializable getLoadedCollectionOwnerIdOrNull(PersistentCollection collection)
PersistenceContext
getLoadedCollectionOwnerIdOrNull
in interface PersistenceContext
collection
- The persistent collectionpublic void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, java.io.Serializable id)
PersistenceContext
addUninitializedCollection
in interface PersistenceContext
public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection)
PersistenceContext
addUninitializedDetachedCollection
in interface PersistenceContext
public void addNewCollection(CollectionPersister persister, PersistentCollection collection) throws HibernateException
PersistenceContext
addNewCollection
in interface PersistenceContext
collection
- The collection to be associated with the persistence contextHibernateException
public void addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection) throws HibernateException
PersistenceContext
addInitializedDetachedCollection
in interface PersistenceContext
HibernateException
public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, java.io.Serializable id) throws HibernateException
PersistenceContext
addInitializedCollection
in interface PersistenceContext
HibernateException
public PersistentCollection getCollection(CollectionKey collectionKey)
PersistenceContext
getCollection
in interface PersistenceContext
public void addNonLazyCollection(PersistentCollection collection)
PersistenceContext
addNonLazyCollection
in interface PersistenceContext
public void initializeNonLazyCollections() throws HibernateException
PersistenceContext
initializeNonLazyCollections
in interface PersistenceContext
HibernateException
public PersistentCollection getCollectionHolder(java.lang.Object array)
PersistenceContext
getCollectionHolder
in interface PersistenceContext
public void addCollectionHolder(PersistentCollection holder)
PersistenceContext
addCollectionHolder
in interface PersistenceContext
public PersistentCollection removeCollectionHolder(java.lang.Object array)
PersistenceContext
removeCollectionHolder
in interface PersistenceContext
public java.io.Serializable getSnapshot(PersistentCollection coll)
PersistenceContext
getSnapshot
in interface PersistenceContext
public CollectionEntry getCollectionEntryOrNull(java.lang.Object collection)
PersistenceContext
getCollectionEntryOrNull
in interface PersistenceContext
public java.lang.Object getProxy(EntityKey key)
PersistenceContext
getProxy
in interface PersistenceContext
public void addProxy(EntityKey key, java.lang.Object proxy)
PersistenceContext
addProxy
in interface PersistenceContext
public java.lang.Object removeProxy(EntityKey key)
PersistenceContext
removeProxy
in interface PersistenceContext
key
- The key of the entity proxy to be removedpublic java.util.HashSet getNullifiableEntityKeys()
PersistenceContext
getNullifiableEntityKeys
in interface PersistenceContext
public java.util.Map getEntitiesByKey()
PersistenceContext
getEntitiesByKey
in interface PersistenceContext
public java.util.Map getProxiesByKey()
public int getNumberOfManagedEntities()
getNumberOfManagedEntities
in interface PersistenceContext
public java.util.Map getEntityEntries()
PersistenceContext
getEntityEntries
in interface PersistenceContext
public java.util.Map getCollectionEntries()
PersistenceContext
getCollectionEntries
in interface PersistenceContext
public java.util.Map getCollectionsByKey()
PersistenceContext
getCollectionsByKey
in interface PersistenceContext
public int getCascadeLevel()
PersistenceContext
getCascadeLevel
in interface PersistenceContext
public int incrementCascadeLevel()
PersistenceContext
incrementCascadeLevel
in interface PersistenceContext
public int decrementCascadeLevel()
PersistenceContext
decrementCascadeLevel
in interface PersistenceContext
public boolean isFlushing()
PersistenceContext
isFlushing
in interface PersistenceContext
public void setFlushing(boolean flushing)
PersistenceContext
setFlushing
in interface PersistenceContext
public boolean isRemovingOrphanBeforeUpates()
public void beginRemoveOrphanBeforeUpdates()
public void endRemoveOrphanBeforeUpdates()
public void beforeLoad()
beforeLoad
in interface PersistenceContext
public void afterLoad()
afterLoad
in interface PersistenceContext
public boolean isLoadFinished()
PersistenceContext
isLoadFinished
in interface PersistenceContext
public java.lang.String toString()
PersistenceContext
toString
in interface PersistenceContext
toString
in class java.lang.Object
public java.util.Map.Entry<java.lang.Object,EntityEntry>[] reentrantSafeEntityEntries()
PersistenceContext
reentrantSafeEntityEntries
in interface PersistenceContext
public java.io.Serializable getOwnerId(java.lang.String entityName, java.lang.String propertyName, java.lang.Object childEntity, java.util.Map mergeMap)
PersistenceContext
getOwnerId
in interface PersistenceContext
entityName
- The entity name for the entity type which would own the childpropertyName
- The name of the property on the owning entity type which would name this child association.childEntity
- The child entity instance for which to locate the owner instance id.mergeMap
- A map of non-persistent instances from an on-going merge operation (possibly null).public java.lang.Object getIndexInOwner(java.lang.String entity, java.lang.String property, java.lang.Object childEntity, java.util.Map mergeMap)
PersistenceContext
getIndexInOwner
in interface PersistenceContext
public void addNullProperty(EntityKey ownerKey, java.lang.String propertyName)
PersistenceContext
addNullProperty
in interface PersistenceContext
public boolean isPropertyNull(EntityKey ownerKey, java.lang.String propertyName)
PersistenceContext
isPropertyNull
in interface PersistenceContext
public boolean isReadOnly(java.lang.Object entityOrProxy)
PersistenceContext
Session.isDefaultReadOnly()
isReadOnly
in interface PersistenceContext
entityOrProxy
- an entity or proxytrue
if the object is read-only; otherwise false
to indicate that the object is
modifiable.public void setReadOnly(java.lang.Object object, boolean readOnly)
PersistenceContext
setReadOnly
in interface PersistenceContext
object
- an entity or proxyreadOnly
- if true
, the entity or proxy is made read-only; otherwise, the entity or proxy is made
modifiable.Session.setDefaultReadOnly(boolean)
,
Session.setReadOnly(java.lang.Object, boolean)
,
Query.setReadOnly(boolean)
public void replaceDelayedEntityIdentityInsertKeys(EntityKey oldKey, java.io.Serializable generatedId)
replaceDelayedEntityIdentityInsertKeys
in interface PersistenceContext
public void serialize(java.io.ObjectOutputStream oos) throws java.io.IOException
oos
- The stream to which the persistence context should get writtenjava.io.IOException
- serialization errors.public static StatefulPersistenceContext deserialize(java.io.ObjectInputStream ois, SessionImplementor session) throws java.io.IOException, java.lang.ClassNotFoundException
ois
- The stream from which the persistence context should be readsession
- The owning sessionjava.io.IOException
- deserialization errors.java.lang.ClassNotFoundException
- deserialization errors.public void addChildParent(java.lang.Object child, java.lang.Object parent)
PersistenceContext
addChildParent
in interface PersistenceContext
child
- The child of the relationshipparent
- The parent of the relationshippublic void removeChildParent(java.lang.Object child)
PersistenceContext
removeChildParent
in interface PersistenceContext
child
- The child to be removed.public void registerInsertedKey(EntityPersister persister, java.io.Serializable id)
PersistenceContext
registerInsertedKey
in interface PersistenceContext
persister
- The entity persisterid
- The idpublic boolean wasInsertedDuringTransaction(EntityPersister persister, java.io.Serializable id)
PersistenceContext
wasInsertedDuringTransaction
in interface PersistenceContext
persister
- The entity persisterid
- The idpublic PersistenceContext.NaturalIdHelper getNaturalIdHelper()
PersistenceContext
getNaturalIdHelper
in interface PersistenceContext
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.