| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | addCollectionHolder(PersistentCollection holder)
Register a PersistentCollection object for an array. |
| public void | |
| public void | |
| 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, boolean lazyPropertiesAreUnfetched)
Adds an entity to the internal caches. |
| 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, boolean lazyPropertiesAreUnfetched)
Generates an appropriate EntityEntry instance and adds it to the event source's internal caches. |
| public CollectionEntry | addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)
add a collection we just pulled out of the cache (does not need initializing) |
| public void | addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection)
add an (initialized) collection that was created by another session and passed into update() (ie. |
| public void | addNewCollection(CollectionPersister persister, PersistentCollection
The collection to be associated with the persistence context collection)Add a new collection (ie. |
| public void | addNonLazyCollection(PersistentCollection collection)
Register a collection for non-lazy loading at the end of the two-phase load |
| public void | addNullProperty(EntityKey ownerKey, String propertyName)
Record the fact that the association belonging to the keyed entity is null. |
| public void | |
| public void | addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)
add a collection we just loaded up (still needs initializing) |
| public void | addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection)
add a detached uninitialized collection |
| public void | addUnownedCollection(CollectionKey key, PersistentCollection collection)
Add a collection which has no owner loaded |
| public void | |
| public void | |
| public void | |
| public void | checkUniqueness(EntityKey key, Object
The entity reference against which to perform the uniqueness check. object)Attempts to check whether the given key represents an entity already loaded within the current session. |
| public void | |
| public boolean | containsCollection(PersistentCollection collection)
Is the given collection associated with this persistence context? |
| public boolean | |
| public boolean | |
| public int | |
| public BatchFetchQueue | |
| public Object[] | |
| public int | |
| public PersistentCollection | getCollection(CollectionKey collectionKey)
Get the collection instance associated with the CollectionKey |
| public Map | |
| public CollectionEntry | |
| public CollectionEntry | getCollectionEntryOrNull(Object collection)
Get the collection entry for a collection passed to filter, which might be a collection wrapper, an array, or an unwrapped collection. |
| public PersistentCollection | |
| public Object | getCollectionOwner(Serializable key, CollectionPersister collectionPersister)
Get the entity that owns this persistent collection |
| public Map | |
| public Object[] | getDatabaseSnapshot(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 |
| public Map | |
| public Object | |
| public Object | |
| public Map | |
| public EntityEntry | |
| public Object | getIndexInOwner(String entity, String property, Object childObject, Map<K, V> mergeMap)
Search the persistence context for an index of the child object, given a collection role |
| public LoadContexts | |
| public Serializable | Returns: the owner ID if available from the collection's loaded key; otherwise, returns nullThe persistent collection collection)Get the ID for the entity that owned this persistent collection when it was loaded |
| public Object | Returns: the owner if its entity ID is available from the collection's loaded key and the owner entity is in the persistence context; otherwise, returns nullThe persistent collection collection)Get the entity that owned this persistent collection when it was loaded |
| public Object[] | getNaturalIdSnapshot(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. |
| public HashSet | |
| public Serializable | getOwnerId(String entity, String property, Object childObject, Map<K, V> mergeMap)
Search the persistence context for an owner for the child object, given a collection role |
| public Object | |
| public SessionImplementor | |
| public Serializable | |
| public boolean | |
| public int | |
| public 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) |
| public boolean | Returns: true, loaded entities/proxies will be made read-only by default; false, loaded entities/proxies will be made modifiable by default.Will entities and proxies that are loaded into this persistence context be made read-only by default? |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isPropertyNull(EntityKey ownerKey, String propertyName)
Is the association property belonging to the keyed entity null? |
| public boolean | Returns: true, the object is read-only; false, the object is modifiable.Is the entity or proxy read-only? |
| public boolean | |
| public Object | Returns: An appropriately narrowed instance.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)If the existing proxy is insufficiently "narrow" (derived), instantiate a new proxy and overwrite the registration of the old one. |
| public Object | proxyFor(EntityPersister persister, EntityKey key, 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. |
| public Object | |
| public boolean | Returns: Whether the passed value represented an actual proxy which got initialized.The possible proxy to be reassociated. value)Takes the given object and, if it represents a proxy, reassociates it with this event source. |
| public void | reassociateProxy(Object value, Serializable id)
If a deleted entity instance is re-saved, and it has a proxy, we need to reset the identifier of the proxy |
| public void | registerInsertedKey(EntityPersister
The entity persister persister, Serializable The id id)Register keys inserted during the current transaction |
| public void | |
| public PersistentCollection | removeCollectionHolder(Object array)
Remove the mapping of collection to holder during eviction of the owning entity |
| public Object | removeEntity(EntityKey key)
Remove an entity from the session cache, also clear up other state associated with the entity, all except for the EntityEntry |
| public EntityEntry | |
| public Object | |
| public void | |
| public void | setDefaultReadOnly(boolean
true, the default for loaded entities/proxies is read-only;
false, the default for loaded entities/proxies is modifiable readOnly)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. |
| public void | |
| public void | |
| public void | setReadOnly(Object
an entity or HibernateProxy entityOrProxy, boolean if true, the entity or proxy is made read-only;
if false, the entity or proxy is made modifiable. readOnly)Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode. |
| public String | Returns: a string representation of the object.Returns a string representation of the object. |
| public Object | |
| public Object | Returns: The unproxied instance.The reference to be unproxied if it currently represents a proxy. maybeProxy)Possibly unproxy the given reference and reassociate it with the current session. |
| public PersistentCollection | useUnownedCollection(CollectionKey key)
Get and remove a collection whose owner is not yet loaded, when its owner is being loaded |
| public boolean | Returns: True if inserted during this transaction, false otherwise.The entity persister persister, Serializable The id id)Allows callers to check to see if the identified entity was inserted during the current transaction. |
| addChildParent | back to summary |
|---|---|
| public void addChildParent(Object parent, Object child) Put child/parent relation to cache for cascading op | |
| addCollectionHolder | back to summary |
|---|---|
| public void addCollectionHolder(PersistentCollection holder) 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(). | |
| addEntity | back to summary |
|---|---|
| public void addEntity(EntityKey key, Object entity) Add a canonical mapping from entity key to entity instance | |
| addEntity | back to summary |
|---|---|
| public void addEntity(EntityUniqueKey euk, Object entity) Add an entity to the cache by unique key | |
| addEntity | back to summary |
|---|---|
| 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, boolean lazyPropertiesAreUnfetched) Adds an entity to the internal caches. | |
| addEntry | back to summary |
|---|---|
| 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, boolean lazyPropertiesAreUnfetched) Generates an appropriate EntityEntry instance and adds it to the event source's internal caches. | |
| addInitializedCollection | back to summary |
|---|---|
| public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) throws HibernateException add a collection we just pulled out of the cache (does not need initializing) | |
| addInitializedDetachedCollection | back to summary |
|---|---|
| public void addInitializedDetachedCollection(CollectionPersister collectionPersister, PersistentCollection collection) throws HibernateException 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) | |
| addNewCollection | back to summary |
|---|---|
| public void addNewCollection(CollectionPersister persister, PersistentCollection collection) throws HibernateException Add a new collection (ie. a newly created one, just instantiated by the application, with no database state or snapshot)
| |
| addNonLazyCollection | back to summary |
|---|---|
| public void addNonLazyCollection(PersistentCollection collection) Register a collection for non-lazy loading at the end of the two-phase load | |
| addNullProperty | back to summary |
|---|---|
| public void addNullProperty(EntityKey ownerKey, String propertyName) Record the fact that the association belonging to the keyed entity is null. | |
| addProxy | back to summary |
|---|---|
| public void addProxy(EntityKey key, Object proxy) Add a proxy to the session cache | |
| addUninitializedCollection | back to summary |
|---|---|
| public void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) add a collection we just loaded up (still needs initializing) | |
| addUninitializedDetachedCollection | back to summary |
|---|---|
| public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) add a detached uninitialized collection | |
| addUnownedCollection | back to summary |
|---|---|
| public void addUnownedCollection(CollectionKey key, PersistentCollection collection) Add a collection which has no owner loaded | |
| afterLoad | back to summary |
|---|---|
| public void afterLoad() Call this after finishing a two-phase load | |
| afterTransactionCompletion | back to summary |
|---|---|
| public void afterTransactionCompletion() Called after transactions end | |
| beforeLoad | back to summary |
|---|---|
| public void beforeLoad() Call this before beginning a two-phase load | |
| checkUniqueness | back to summary |
|---|---|
| public void checkUniqueness(EntityKey key, Object object) throws HibernateException Attempts to check whether the given key represents an entity already loaded within the current session.
| |
| clear | back to summary |
|---|---|
| public void clear() Clear the state of the persistence context | |
| containsCollection | back to summary |
|---|---|
| public boolean containsCollection(PersistentCollection collection) Is the given collection associated with this persistence context? | |
| containsEntity | back to summary |
|---|---|
| public boolean containsEntity(EntityKey key) Is there an entity with the given key in the persistence context | |
| containsProxy | back to summary |
|---|---|
| public boolean containsProxy(Object proxy) Is the given proxy associated with this persistence context? | |
| decrementCascadeLevel | back to summary |
|---|---|
| public int decrementCascadeLevel() Called after cascading | |
| getBatchFetchQueue | back to summary |
|---|---|
| public BatchFetchQueue getBatchFetchQueue() Get the BatchFetchQueue, instantiating one if necessary. | |
| getCachedDatabaseSnapshot | back to summary |
|---|---|
| public Object[] getCachedDatabaseSnapshot(EntityKey key) | |
| getCascadeLevel | back to summary |
|---|---|
| public int getCascadeLevel() How deep are we cascaded? | |
| getCollection | back to summary |
|---|---|
| public PersistentCollection getCollection(CollectionKey collectionKey) Get the collection instance associated with the CollectionKey | |
| getCollectionEntries | back to summary |
|---|---|
| public Map Get the mapping from collection instance to collection entry | |
| getCollectionEntry | back to summary |
|---|---|
| public CollectionEntry getCollectionEntry(PersistentCollection coll) Get the collection entry for a persistent collection | |
| getCollectionEntryOrNull | back to summary |
|---|---|
| public CollectionEntry getCollectionEntryOrNull(Object collection) 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. | |
| getCollectionHolder | back to summary |
|---|---|
| public PersistentCollection getCollectionHolder(Object array) Get the PersistentCollection object for an array | |
| getCollectionOwner | back to summary |
|---|---|
| public Object getCollectionOwner(Serializable key, CollectionPersister collectionPersister) throws MappingException Get the entity that owns this persistent collection | |
| getCollectionsByKey | back to summary |
|---|---|
| public Map Get the mapping from collection key to collection instance | |
| getDatabaseSnapshot | back to summary |
|---|---|
| public Object[] getDatabaseSnapshot(Serializable id, EntityPersister persister) throws HibernateException Get the current state of the entity as known to the underlying database, or null if there is no corresponding row | |
| getEntitiesByKey | back to summary |
|---|---|
| public Map Get the mapping from key value to entity instance | |
| getEntity | back to summary |
|---|---|
| public Object getEntity(EntityKey key) Get the entity instance associated with the given EntityKey | |
| getEntity | back to summary |
|---|---|
| public Object getEntity(EntityUniqueKey euk) Get an entity cached by unique key | |
| getEntityEntries | back to summary |
|---|---|
| public Map Get the mapping from entity instance to entity entry | |
| getEntry | back to summary |
|---|---|
| public EntityEntry getEntry(Object entity) Retrieve the EntityEntry representation of the given entity.
| |
| getIndexInOwner | back to summary |
|---|---|
| public Object getIndexInOwner(String entity, String property, Object childObject, Map<K, V> mergeMap) Search the persistence context for an index of the child object, given a collection role | |
| getLoadContexts | back to summary |
|---|---|
| public LoadContexts getLoadContexts() Retrieve this persistence context's managed load context.
| |
| getLoadedCollectionOwnerIdOrNull | back to summary |
|---|---|
| public Serializable getLoadedCollectionOwnerIdOrNull(PersistentCollection collection) Get the ID for the entity that owned this persistent collection when it was loaded
| |
| getLoadedCollectionOwnerOrNull | back to summary |
|---|---|
| public Object getLoadedCollectionOwnerOrNull(PersistentCollection collection) Get the entity that owned this persistent collection when it was loaded
| |
| getNaturalIdSnapshot | back to summary |
|---|---|
| public Object[] getNaturalIdSnapshot(Serializable id, EntityPersister persister) throws HibernateException 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. | |
| getNullifiableEntityKeys | back to summary |
|---|---|
| public HashSet Retrieve the set of EntityKeys representing nullifiable references | |
| getOwnerId | back to summary |
|---|---|
| public Serializable getOwnerId(String entity, String property, Object childObject, Map<K, V> mergeMap) Search the persistence context for an owner for the child object, given a collection role | |
| getProxy | back to summary |
|---|---|
| public Object getProxy(EntityKey key) Get an existing proxy by key | |
| getSession | back to summary |
|---|---|
| public SessionImplementor getSession() Get the session to which this persistence context is bound.
| |
| getSnapshot | back to summary |
|---|---|
| public Serializable getSnapshot(PersistentCollection coll) Get the snapshot of the pre-flush collection state | |
| hasNonReadOnlyEntities | back to summary |
|---|---|
public boolean hasNonReadOnlyEntities()
| |
| incrementCascadeLevel | back to summary |
|---|---|
| public int incrementCascadeLevel() Called before cascading | |
| initializeNonLazyCollections | back to summary |
|---|---|
| public void initializeNonLazyCollections() throws HibernateException 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) | |
| isDefaultReadOnly | back to summary |
|---|---|
| public 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:
| |
| isEntryFor | back to summary |
|---|---|
| public boolean isEntryFor(Object entity) Is there an EntityEntry for this instance? | |
| isFlushing | back to summary |
|---|---|
| public boolean isFlushing() Is a flush cycle currently in process? | |
| isLoadFinished | back to summary |
|---|---|
| public boolean isLoadFinished() Is in a two-phase load? | |
| isPropertyNull | back to summary |
|---|---|
| public boolean isPropertyNull(EntityKey ownerKey, String propertyName) Is the association property belonging to the keyed entity null? | |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly(Object entityOrProxy) Is the entity or proxy read-only? To get the default read-only/modifiable setting used for entities and proxies that are loaded into the session:
| |
| isStateless | back to summary |
|---|---|
| public boolean isStateless() | |
| narrowProxy | back to summary |
|---|---|
| public Object narrowProxy(Object proxy, EntityPersister persister, EntityKey key, Object object) throws HibernateException 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.
| |
| proxyFor | back to summary |
|---|---|
| public Object proxyFor(EntityPersister persister, EntityKey key, Object impl) throws HibernateException 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. | |
| proxyFor | back to summary |
|---|---|
| public Object proxyFor(Object impl) throws HibernateException 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) | |
| reassociateIfUninitializedProxy | back to summary |
|---|---|
| public boolean reassociateIfUninitializedProxy(Object value) throws MappingException Takes the given object and, if it represents a proxy, reassociates it with this event source.
| |
| reassociateProxy | back to summary |
|---|---|
| public void reassociateProxy(Object value, Serializable id) throws MappingException If a deleted entity instance is re-saved, and it has a proxy, we need to reset the identifier of the proxy | |
| registerInsertedKey | back to summary |
|---|---|
| public void registerInsertedKey(EntityPersister persister, Serializable id) Register keys inserted during the current transaction
| |
| removeChildParent | back to summary |
|---|---|
| public void removeChildParent(Object child) Remove child/parent relation from cache | |
| removeCollectionHolder | back to summary |
|---|---|
| public PersistentCollection removeCollectionHolder(Object array) Remove the mapping of collection to holder during eviction of the owning entity | |
| removeEntity | back to summary |
|---|---|
| public Object removeEntity(EntityKey key) Remove an entity from the session cache, also clear up other state associated with the entity, all except for the EntityEntry | |
| removeEntry | back to summary |
|---|---|
| public EntityEntry removeEntry(Object entity) Remove an entity entry from the session cache | |
| removeProxy | back to summary |
|---|---|
| public Object removeProxy(EntityKey key) Remove a proxy from the session cache | |
| replaceDelayedEntityIdentityInsertKeys | back to summary |
|---|---|
| public void replaceDelayedEntityIdentityInsertKeys(EntityKey oldKey, Serializable generatedId) | |
| setDefaultReadOnly | back to summary |
|---|---|
| public void setDefaultReadOnly(boolean readOnly) 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. Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted. When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the persistence context's current setting. To change the read-only/modifiable setting for a particular entity or proxy that is already in this session: + * @see PersistenceContext#setReadOnly(Object,boolean)
| |
| setEntryStatus | back to summary |
|---|---|
| public void setEntryStatus(EntityEntry entry, Status status) Set the status of an entry | |
| setFlushing | back to summary |
|---|---|
| public void setFlushing(boolean flushing) Called before and after the flushcycle | |
| setReadOnly | back to summary |
|---|---|
| public void setReadOnly(Object entityOrProxy, boolean readOnly) Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode. Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted. When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the session's current setting. If the entity or proxy already has the specified read-only/modifiable setting, then this method does nothing. To set the default read-only/modifiable setting used for entities and proxies that are loaded into this persistence context:
| |
| toString | back to summary |
|---|---|
| public String toString() Returns a string representation of the object.
| |
| unproxy | back to summary |
|---|---|
| public Object unproxy(Object maybeProxy) throws HibernateException 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. | |
| unproxyAndReassociate | back to summary |
|---|---|
| public Object unproxyAndReassociate(Object maybeProxy) throws HibernateException Possibly unproxy the given reference and reassociate it with the current session. | |
| useUnownedCollection | back to summary |
|---|---|
| public PersistentCollection useUnownedCollection(CollectionKey key) Get and remove a collection whose owner is not yet loaded, when its owner is being loaded | |
| wasInsertedDuringTransaction | back to summary |
|---|---|
| public boolean wasInsertedDuringTransaction(EntityPersister persister, Serializable id) Allows callers to check to see if the identified entity was inserted during the current transaction.
| |