java.lang.Object | |
↳ | org.hibernate.proxy.AbstractLazyInitializer |
Known Direct Subclasses |
Known Indirect Subclasses |
Convenience base class for lazy initialization handlers. Centralizes the basic plumbing of doing lazy initialization freeing subclasses to acts as essentially adapters to their intended entity mode and/or proxy generation strategy.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
For serialization from the non-pojo initializers (HHH-3309)
| |||||||||||
Main constructor.
|
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,
do not initialize the proxy
| |||||||||||
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.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Getter for property 'target'.
| |||||||||||
Getter for property 'connectedToSession'.
| |||||||||||
Get the read-only/modifiable setting that should be put in affect when it is
attached to a session.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.hibernate.proxy.LazyInitializer
|
For serialization from the non-pojo initializers (HHH-3309)
Main constructor.
entityName | The name of the entity being proxied. |
---|---|
id | The identifier of the entity being proxied. |
session | The session owning the proxy. |
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, do not initialize the proxy
s | The session to check |
---|
HibernateException |
---|
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 |
---|
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:
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.
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.s | The session |
---|
HibernateException |
---|
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.
Getter for property 'target'.
Same asgetImplementation()
except that this method will not force initialization.Getter for property 'connectedToSession'.
Get the read-only/modifiable setting that should be put in affect when it is attached to a session. This method should only be called during serialization when read-only/modifiable setting is not available (i.e., isReadOnlySettingAvailable() == false)
IllegalStateException | if isReadOnlySettingAvailable() == true |
---|