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 org.
and a PersistentContext. Event listeners and other Session collaborators then use the PersistentContext to drive
their processing.
| Modifier and Type | Class and Description |
|---|---|
| private static interface |
| Modifier and Type | Field and Description |
|---|---|
| private IdentityHashMap | |
| private BatchFetchQueue | |
| private int | |
| private IdentityMap | |
| private HashMap | |
| private boolean | |
| private HashMap | |
| private HashMap | |
| private EntityEntryContext | |
| private HashMap | |
| private boolean | |
| private boolean | |
| private static final int | |
| private HashMap | |
| private LoadContexts | |
| private int | |
| private static final CoreMessageLogger | |
| private final PersistenceContext. | |
| private NaturalIdXrefDelegate | |
| private ArrayList | |
| private HashSet | |
| private HashSet | |
| private IdentityHashMap | |
| private ConcurrentReferenceHashMap | |
| private int | |
| private SharedSessionContractImplementor | |
| private HashMap |
| Access | Constructor and Description |
|---|---|
| public | StatefulPersistenceContext(SharedSessionContractImplementor
The session "owning" this context. session)Constructs a PersistentContext, bound to the given session. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addChildParent(Object
The child of the relationship child, Object The parent of the relationship parent)Implements org. |
| private void | addCollection(PersistentCollection
The collection for which we are adding an entry. coll, CollectionEntry The entry representing the collection. entry, Serializable The key of the collection's entry. key)Add a collection to the cache, with a given collection entry. |
| private void | addCollection(PersistentCollection
The collection for which we are adding an entry. collection, CollectionPersister The collection persister persister)Add a collection to the cache, creating a new collection entry for it |
| public PersistentCollection | addCollectionByKey(CollectionKey collectionKey, PersistentCollection persistentCollection)
Implements org. |
| public void | addCollectionHolder(PersistentCollection holder)
Implements org. |
| public void | addEnhancedProxy(EntityKey key, PersistentAttributeInterceptable entity)
Implements org. addEntity(EntityKey, Object) and addProxy(EntityKey, Object)
for use with enhancement-as-proxy
|
| public void | addEntity(EntityKey
The key under which to add an entity key, Object The entity instance to add entity)Implements org. |
| public void | addEntity(EntityUniqueKey
The unique (non-primary) key under which to add an entity euk, Object The entity instance entity)Implements org. |
| public EntityEntry | addEntity(final Object entity, final Status status, final Object[] loadedState, final EntityKey entityKey, final Object version, final LockMode lockMode, final boolean existsInDatabase, final EntityPersister persister, final boolean disableVersionIncrement)
Implements org. |
| public EntityEntry | addEntry(final Object entity, final Status status, final Object[] loadedState, final Object rowId, final Serializable id, final Object version, final LockMode lockMode, final boolean existsInDatabase, final EntityPersister persister, final boolean disableVersionIncrement)
Implements org. |
| public CollectionEntry | addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)
Implements org. |
| public void | addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection)
Implements org. |
| public void | addNewCollection(CollectionPersister persister, PersistentCollection
The collection to be associated with the persistence context collection)Implements org. |
| public void | addNonLazyCollection(PersistentCollection collection)
Implements org. |
| public void | addNullProperty(EntityKey ownerKey, String propertyName)
Implements org. |
| public void | addProxy(EntityKey key, Object proxy)
Implements org. |
| public EntityEntry | |
| public void | addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)
Implements org. |
| public void | addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection)
Implements org. |
| public void | addUnownedCollection(CollectionKey
The collection key under which to add the collection key, PersistentCollection The collection to add collection)Implements org. |
| public void | afterLoad()
Implements org. |
| public void | afterTransactionCompletion()
Implements org. |
| public void | beforeLoad()
Implements org. |
| public void | |
| public void | checkUniqueness(EntityKey key, Object
The entity reference against which to perform the uniqueness check. object)Implements org. |
| private void | |
| public void | clear()
Implements org. |
| public void | clearCollectionsByKey()
Implements org. |
| private void | |
| public boolean | containsCollection(PersistentCollection collection)
Implements org. |
| public boolean | containsEntity(EntityKey
The key under which to look for an entity key)Implements org. |
| public boolean | containsNullifiableEntityKey(Supplier<EntityKey>
a supplier for the EntityKey; this allows to not always needing to create the key;
for example if the map is known to be empty there is no need to create one to check. sek)Implements org. EntityKey was registered as nullifiable on this PersistenceContext.
|
| public boolean | containsProxy(Object entity)
Implements org. |
| public int | decrementCascadeLevel()
Implements org. |
| public static StatefulPersistenceContext | Returns: The deserialized StatefulPersistenceContextThe stream from which the persistence context should be read ois, SessionImplementor The owning session session)
Deprecated
as a consequence of
Used by the owning session to explicitly control deserialization of the persistence context.
SessionImplementor being deprecated.
|
| public void | |
| public void | forEachCollectionEntry(BiConsumer<PersistentCollection, CollectionEntry>
the lambda to apply on each PersistentCollection,CollectionEntry map entry of the PersistenceContext. action, boolean set this to false for improved efficiency, but that would make it illegal to make changes to the underlying collectionEntries map. concurrent)Implements org. |
| public BatchFetchQueue | getBatchFetchQueue()
Implements org. BatchFetchQueue, instantiating one if necessary.
|
| public Object[] | getCachedDatabaseSnapshot(EntityKey
The entity key for which to retrieve the cached snapshot key)Implements org. |
| public int | getCascadeLevel()
Implements org. |
| public PersistentCollection | getCollection(CollectionKey collectionKey)
Implements org. |
| public Map | Returns: the map of managed collection entries.Implements org.
Deprecated
We should not expose this directly: the other accessors that have been created as a replacement
have better chances of skipping initializing this map, which is a good performance improvement.
Get the mapping from collection instance to collection entry
|
| public int | getCollectionEntriesSize()
Implements org. |
| public CollectionEntry | getCollectionEntry(PersistentCollection
The persistent collection instance for which to locate the collection entry coll)Implements org. |
| public CollectionEntry | getCollectionEntryOrNull(Object collection)
Implements org. |
| public PersistentCollection | getCollectionHolder(Object array)
Implements org. |
| public Object | getCollectionOwner(Serializable key, CollectionPersister collectionPersister)
Implements org. |
| public Map | getCollectionsByKey()
Implements org. |
| public Object[] | getDatabaseSnapshot(Serializable
The identifier of the entity for which to grab a snapshot id, EntityPersister The persister of the entity. persister)Implements org. Get the current state of the entity as known to the underlying database, or null if there is no corresponding row |
| public Map | getEntitiesByKey()
Implements org.
Deprecated
this will be removed: it provides too wide access, making it hard to optimise the internals
for specific access needs. Consider using #iterateEntities instead.
Get the mapping from key value to entity instance
|
| public Object | getEntity(EntityKey
The key under which to look for an entity key)Implements org. |
| public Object | getEntity(EntityUniqueKey
The unique (non-primary) key under which to look for an entity euk)Implements org. |
| public Map | getEntityEntries()
Implements org. |
| public EntityEntry | getEntry(Object
The entity instance for which to locate the corresponding entry entity)Implements org. EntityEntry representation of the given entity.
|
| public Object | getIndexInOwner(String entity, String property, Object childEntity, Map<K, V> mergeMap)
Implements org. |
| private Object | getIndexInParent(String property, Object childEntity, EntityPersister persister, CollectionPersister collectionPersister, Object potentialParent)
|
| public LoadContexts | getLoadContexts()
Implements org. |
| public Serializable | getLoadedCollectionOwnerIdOrNull(PersistentCollection
The persistent collection collection)Implements org. |
| private Serializable | Returns: the owner ID if available from the collection's loaded key; otherwise, returns nullThe collection entry ce)Get the ID for the entity that owned this persistent collection when it was loaded |
| public Object | getLoadedCollectionOwnerOrNull(PersistentCollection
The persistent collection collection)Implements org. |
| public PersistenceContext. | getNaturalIdHelper()
Implements org. |
| public Object[] | getNaturalIdSnapshot(Serializable
The identifier of the entity for which to grab a snapshot id, EntityPersister The persister of the entity. persister)Implements org. |
| private Object[] | |
| private NaturalIdXrefDelegate | |
| public HashSet | getNullifiableEntityKeys()
Implements org. |
| public int | |
| private IdentityMap | |
| private ConcurrentMap | |
| public Serializable | getOwnerId(String
The entity name for the entity type which would own the child entityName, String The name of the property on the owning entity type which would name this child association. propertyName, Object The child entity instance for which to locate the owner instance id. childEntity, Map<K, V> A map of non-persistent instances from an on-going merge operation (possibly null). mergeMap)Implements org. |
| private Object | |
| public Object | getProxy(EntityKey key)
Implements org. |
| public SharedSessionContractImplementor | getSession()
Implements org. |
| public Serializable | getSnapshot(PersistentCollection coll)
Implements org. |
| public boolean | |
| public int | incrementCascadeLevel()
Implements org. |
| public void | initializeNonLazyCollections()
Implements org. |
| protected void | |
| public boolean | isDefaultReadOnly()
Implements org. |
| public boolean | isEntryFor(Object
The entity instance for which to check for an entry entity)Implements org. EntityEntry registration for this entity instance?
|
| public boolean | isFlushing()
Implements org. |
| private boolean | isFoundInParent(String property, Object childEntity, EntityPersister persister, CollectionPersister collectionPersister, Object potentialParent)
|
| public boolean | isLoadFinished()
Implements org. |
| public boolean | |
| public boolean | isPropertyNull(EntityKey ownerKey, String propertyName)
Implements org. |
| public boolean | isReadOnly(Object
an entity or proxy entityOrProxy)Implements org. |
| public boolean | |
| public boolean | |
| private EntityPersister | |
| public Iterator | managedEntitiesIterator()
Implements org. |
| public Object | narrowProxy(Object
The proxy instance to be narrowed. proxy, EntityPersister The persister for the proxied entity. persister, EntityKey The internal cache key for the proxied entity. key, Object (optional) the actual proxied entity instance. object)Implements org. |
| public Object | proxyFor(EntityPersister persister, EntityKey key, Object impl)
Implements org. |
| public Object | proxyFor(Object impl)
Implements org. |
| public boolean | reassociateIfUninitializedProxy(Object
The possible proxy to be reassociated. value)Implements org. |
| public void | reassociateProxy(Object value, Serializable id)
Implements org. |
| private void | reassociateProxy(LazyInitializer
The proxy initializer. li, HibernateProxy The proxy to reassociate. proxy)Associate a proxy that was instantiated by another session with this session |
| public Map. | reentrantSafeEntityEntries()
Implements org. |
| public void | registerInsertedKey(EntityPersister
The entity persister persister, Serializable The id id)Implements org. |
| public void | registerNullifiableEntityKey(EntityKey key)
Implements org. EntityKey as nullifiable on this PersistenceContext.
|
| public void | removeChildParent(Object
The child to be removed. child)Implements org. |
| public void | removeCollectionByKey(CollectionKey
the key to clear collectionKey)Implements org. |
| public CollectionEntry | removeCollectionEntry(PersistentCollection
the collection to remove collection)Implements org. PersistentCollection from the PersistenceContext.
|
| public PersistentCollection | removeCollectionHolder(Object array)
Implements org. |
| public Object | removeEntity(EntityKey
The key whose matching entity should be removed key)Implements org. |
| public EntityEntry | removeEntry(Object
The entity instance for which to remove the corresponding entry entity)Implements org. |
| public Object | removeProxy(EntityKey
The key of the entity proxy to be removed key)Implements org. |
| private Object | |
| public void | |
| public void | serialize(ObjectOutputStream
The stream to which the persistence context should get written oos)Used by the owning session to explicitly control serialization of the persistence context. |
| public void | setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiable defaultReadOnly)Implements org. |
| private void | |
| public void | setEntryStatus(EntityEntry
The entry for which to set the status entry, Status The new status status)Implements org. |
| public void | setFlushing(boolean flushing)
Implements org. |
| private void | |
| private void | |
| public void | setReadOnly(Object
an entity or proxy object, boolean if readOnly)true, the entity or proxy is made read-only; otherwise, the entity or proxy is made
modifiable.Implements org. |
| public String | toString()
Overrides java. Implements org. |
| public Object | unproxy(Object maybeProxy)
Implements org. |
| public Object | unproxyAndReassociate(Object
The reference to be unproxied if it currently represents a proxy. maybeProxy)Implements org. |
| private static void | unsetSession(PersistentAttributeInterceptable persistentAttributeInterceptable, Object ignoredParam)
|
| public PersistentCollection | useUnownedCollection(CollectionKey
The collection key for which to locate a collection collection key)Implements org. |
| public boolean | wasInsertedDuringTransaction(EntityPersister
The entity persister persister, Serializable The id id)Implements org. |
| private <E> void | writeCollectionToStream(Collection<E> collection, ObjectOutputStream oos, String keysName, StatefulPersistenceContext.
|
| private <K, V> void | writeMapToStream(Map<K, V> map, ObjectOutputStream oos, String keysName, StatefulPersistenceContext.
|