The IPersistenceContext type exposes the following members.

Methods

  NameDescription
Public methodAddChildParent
Add child/parent relation to cache for cascading operations
Public methodAddCollectionHolder
Register a PersistentCollection object for an array. Associates a holder with an array - MUST be called after loading array, since the array instance is not created until endLoad().
Public methodAddEntity(EntityKey, Object)
Add a canonical mapping from entity key to entity instance
Public methodAddEntity(EntityUniqueKey, Object)
Add an entity to the cache by unique key
Public methodAddEntity(Object, Status, array<Object>[]()[][], EntityKey, Object, LockMode, Boolean, IEntityPersister, Boolean, Boolean)
Adds an entity to the internal caches.
Public methodAddEntry
Generates an appropriate EntityEntry instance and adds it to the event source's internal caches.
Public methodAddInitializedCollection
add a collection we just pulled out of the cache (does not need initializing)
Public methodAddInitializedDetachedCollection
add an (initialized) collection that was created by another session and passed into update() (ie. one with a snapshot and existing state on the database)
Public methodAddNewCollection
Add a new collection (ie. a newly created one, just instantiated by the application, with no database state or snapshot)
Public methodAddNonLazyCollection
Register a collection for non-lazy loading at the end of the two-phase load
Public methodAddNullProperty
Record the fact that the association belonging to the keyed entity is null.
Public methodAddProxy
Add a proxy to the session cache
Public methodAddUninitializedCollection
add a collection we just loaded up (still needs initializing)
Public methodAddUninitializedDetachedCollection
add a detached uninitialized collection
Public methodAddUnownedCollection
Add a collection which has no owner loaded
Public methodAfterLoad
Call this after finishing a two-phase load
Public methodAfterTransactionCompletion
Called after transactions end
Public methodBeforeLoad
Call this before beginning a two-phase load
Public methodCheckUniqueness
Attempts to check whether the given key represents an entity already loaded within the current session.
Public methodClear
Clear the state of the persistence context
Public methodContainsCollection
Is the given collection associated with this persistence context?
Public methodContainsEntity
Is there an entity with the given key in the persistence context
Public methodContainsProxy
Is the given proxy associated with this persistence context?
Public methodDecrementCascadeLevel
Called after cascading
Public methodGetCachedDatabaseSnapshot
Retrieve the cached database snapshot for the requested entity key.
Public methodGetCollection
Get the collection instance associated with the CollectionKey
Public methodGetCollectionEntry
Get the collection entry for a persistent collection
Public methodGetCollectionEntryOrNull
Get the collection entry for a collection passed to filter, which might be a collection wrapper, an array, or an unwrapped collection. Return null if there is no entry.
Public methodGetCollectionHolder
Get the PersistentCollection object for an array
Public methodGetCollectionOwner
Get the entity that owns this persistent collection
Public methodGetDatabaseSnapshot
Get the current state of the entity as known to the underlying database, or null if there is no corresponding row
Public methodGetEntity(EntityKey)
Get the entity instance associated with the given EntityKey
Public methodGetEntity(EntityUniqueKey)
Get an entity cached by unique key
Public methodGetEntry
Retrieve the EntityEntry representation of the given entity.
Public methodGetIndexInOwner
Search the persistence context for an index of the child object, given a collection role
Public methodGetLoadedCollectionOwnerIdOrNull
Get the ID for the entity that owned this persistent collection when it was loaded
Public methodGetLoadedCollectionOwnerOrNull
Get the entity that owned this persistent collection when it was loaded
Public methodGetNaturalIdSnapshot
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.
Public methodGetOwnerId
Search the persistence context for an owner for the child object, given a collection role
Public methodGetProxy
Get an existing proxy by key
Public methodGetSnapshot
Get the snapshot of the pre-flush collection state
Public methodIncrementCascadeLevel
Called before cascading
Public methodInitializeNonLazyCollections
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)
Public methodIsEntryFor
Is there an EntityEntry for this instance?
Public methodIsPropertyNull
Is the association property belonging to the keyed entity null?
Public methodIsReadOnly
Is the specified entity (or proxy) read-only?
Public methodNarrowProxy
If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy and overwrite the registration of the old one. This breaks == and occurs only for "class" proxies rather than "interface" proxies. Also init the proxy to point to the given target implementation if necessary.
Public methodProxyFor(Object)
Return the existing proxy associated with the given EntityKey, or the argument (the entity associated with the key) if no proxy exists. (slower than the form above)
Public methodProxyFor(IEntityPersister, EntityKey, Object)
Return the existing proxy associated with the given EntityKey, or the third argument (the entity associated with the key) if no proxy exists. Init the proxy to the target implementation, if necessary.
Public methodReassociateIfUninitializedProxy
Takes the given object and, if it represents a proxy, reassociates it with this event source.
Public methodReassociateProxy
If a deleted entity instance is re-saved, and it has a proxy, we need to reset the identifier of the proxy
Public methodRemoveChildParent
Remove child/parent relation from cache
Public methodRemoveCollectionHolder
Remove the mapping of collection to holder during eviction of the owning entity
Public methodRemoveEntity
Remove an entity from the session cache, also clear up other state associated with the entity, all except for the EntityEntry
Public methodRemoveEntry
Remove an entity entry from the session cache
Public methodRemoveProxy
Remove a proxy from the session cache
Public methodReplaceDelayedEntityIdentityInsertKeys
Public methodSetEntryStatus
Set the status of an entry
Public methodSetReadOnly
Change the read-only status of an entity (or proxy).
Public methodUnproxy
Get the entity instance underlying the given proxy, throwing an exception if the proxy is uninitialized. If the given object is not a proxy, simply return the argument.
Public methodUnproxyAndReassociate
Possibly unproxy the given reference and reassociate it with the current session.
Public methodUseUnownedCollection
Get and remove a collection whose owner is not yet loaded, when its owner is being loaded

Properties

  NameDescription
Public propertyBatchFetchQueue
Get the BatchFetchQueue, instantiating one if necessary.
Public propertyCascadeLevel
How deep are we cascaded?
Public propertyCollectionEntries
Get the mapping from collection instance to collection entry
Public propertyCollectionsByKey
Get the mapping from collection key to collection instance
Public propertyDefaultReadOnly
The read-only status for entities (and proxies) loaded into this persistence context.
Public propertyEntitiesByKey
Get the mapping from key value to entity instance
Public propertyEntityEntries
Get the mapping from entity instance to entity entry
Public propertyFlushing
Is a flush cycle currently in process?
Public propertyHasNonReadOnlyEntities
False if we know for certain that all the entities are read-only
Public propertyIsLoadFinished
Is in a two-phase load?
Public propertyIsStateless
Public propertyLoadContexts
Retrieve this persistence context's managed load context.
Public propertyNullifiableEntityKeys
Retrieve the set of EntityKeys representing nullifiable references
Public propertySession
Get the session to which this persistence context is bound.

See Also