org.hibernate.proxy.LazyInitializer |
Known Indirect Subclasses |
Handles fetching of the underlying entity for a proxy
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The entity-name of the entity our owning proxy represents.
| |||||||||||
Retrieve the identifier value for the enity our owning proxy represents.
| |||||||||||
Return the underlying persistent object, initializing if necessary
| |||||||||||
Return the underlying persistent object in the given session, or null if not contained in this session's
persistence context.
| |||||||||||
Get the actual class of the entity.
| |||||||||||
Get the session to which this proxy is associated, or null if it is not attached.
| |||||||||||
Initialize the proxy, fetching the target entity if necessary.
| |||||||||||
Is the proxy read-only?.
| |||||||||||
Is the proxy's read-only/modifiable setting available?
| |||||||||||
Is the proxy uninitialzed?
| |||||||||||
Set the identifier value for the enity our owning proxy represents.
| |||||||||||
Initialize the proxy manually by injecting its target.
| |||||||||||
Set an associated modifiable proxy to read-only mode, or a read-only
proxy to modifiable mode.
| |||||||||||
Associate the proxy with the given session.
| |||||||||||
Unset this initializer's reference to session.
|
The entity-name of the entity our owning proxy represents.
Retrieve the identifier value for the enity our owning proxy represents.
Return the underlying persistent object, initializing if necessary
Return the underlying persistent object in the given session, or null if not contained in this session's persistence context.
session | The session to check |
---|
HibernateException | Indicates problem locating the target. |
---|
Get the actual class of the entity. Generally, getEntityName()
should be used instead.
Get the session to which this proxy is associated, or null if it is not attached.
Initialize the proxy, fetching the target entity if necessary.
HibernateException | Indicates a problem initializing the proxy. |
---|
Is the proxy read-only?. The read-only/modifiable setting is not available when the proxy is detached or its associated session is closed. To check if the read-only/modifiable setting is available:
TransientObjectException | if the proxy is detached (getSession() == null) |
---|---|
SessionException | if the proxy is associated with a sesssion that is closed |
Is the proxy's read-only/modifiable setting available?
Is the proxy uninitialzed?
Set the identifier value for the enity our owning proxy represents.
id | The identifier value. |
---|
Initialize the proxy manually by injecting its target.
target | The proxy target (the actual entity being proxied). |
---|
Set an associated modifiable proxy to read-only mode, or a read-only proxy to modifiable mode. If the proxy is currently initialized, its implementation will be set to the same mode; otherwise, when the proxy is initialized, its implementation will have the same read-only/ modifiable setting as the proxy. In read-only mode, no snapshot is maintained and the instance is never dirty checked. If the associated proxy already has the specified read-only/modifiable setting, then this method does nothing.
TransientObjectException | if the proxy is not association with a session |
---|---|
SessionException | if the proxy is associated with a sesssion that is closed |
Associate the proxy with the given session.
Care should be given to make certain that the proxy is added to the session's persistence context as well to maintain the symetry of the association. That must be done seperately as this method simply sets an internal reference. We do also check that if there is already an associated session that the proxy reference was removed from that previous session's persistence contet.session | The session |
---|
HibernateException | Indicates that the proxy was still contained in the persistence context of the "previous session". |
---|
Unset this initializer's reference to session. It is assumed that the caller is also taking care or cleaning up the owning proxy's reference in the persistence context.
Generally speaking this is intended to be called only duringevict(Object)
and
clear()
processing; most other use-cases should call setSession(SessionImplementor)
instead.