| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private String | |
| private Serializable | |
| private boolean | |
| private static final CoreMessageLogger | |
| private boolean | |
| private Boolean | |
| private transient SharedSessionContractImplementor | |
| private String | |
| private Object | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| protected | AbstractLazyInitializer()
Deprecated
This constructor was initially intended for serialization only, and is not useful anymore.
|
| protected | AbstractLazyInitializer(String
The name of the entity being proxied. entityName, Serializable The identifier of the entity being proxied. id, SharedSessionContractImplementor The session owning the proxy. session)Main constructor. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | afterDeserialization(Boolean
the read-only/modifiable setting to use when
associated with a session; null indicates that the default should be used. readOnlyBeforeAttachedToSession, String the session factory uuid, to be used if sessionFactoryUuid, boolean allowLoadOutsideTransaction is true.whether the proxy can load data even
if it's not attached to a session with an ongoing transaction. allowLoadOutsideTransaction)Restore settings that are not passed to the constructor, but are still preserved during serialization. |
| private void | |
| private void | |
| private static EntityKey | |
| public final String | getEntityName()
Implements org. |
| public final Serializable | getIdentifier()
Implements org. |
| public final Object | getImplementation()
Implements org. |
| public final Object | getImplementation(SharedSessionContractImplementor
The session to check s)Implements org. |
| public final Serializable | getInternalIdentifier()
Overrides default org. |
| private Object | |
| public final SharedSessionContractImplementor | getSession()
Implements org. |
| protected String | |
| protected final Object | |
| public final void | initialize()
Implements org. |
| public final void | initializeWithoutLoadIfPossible()
Attempt to initialize the proxy without loading anything from the database. |
| protected boolean | Returns: true if out-of-transaction loads are allowed, false otherwise.Get whether the proxy can load data even if it's not attached to a session with an ongoing transaction. |
| protected final boolean | Returns: Value for property 'connectedToSession'.Getter for property 'connectedToSession'. |
| private boolean | |
| public final boolean | |
| public final Boolean | Returns: null, if the default setting should be used; true, for read-only; false, for modifiableGet the read-only/modifiable setting that should be put in affect when it is attached to a session. |
| public final boolean | isReadOnlySettingAvailable()
Implements org. |
| public final boolean | isUninitialized()
Implements org. |
| public boolean | |
| protected void | |
| protected void | prepareForPossibleLoadingOutsideTransaction()
Initialize internal state based on the currently attached session, in order to be ready to load data even after the proxy is detached from the session. |
| public final void | setIdentifier(Serializable
The identifier value. id)Implements org. |
| public final void | setImplementation(Object
The proxy target (the actual entity being proxied). target)Implements org. |
| public final void | setReadOnly(boolean
if true, the associated proxy is made read-only;
if false, the associated proxy is made modifiable. readOnly)Implements org. |
| public final void | setSession(SharedSessionContractImplementor
The session s)Implements org. |
| public void | |
| public final void | unsetSession()
Implements org. |
| allowLoadOutsideTransaction | back to summary |
|---|---|
| private boolean allowLoadOutsideTransaction | |
| entityName | back to summary |
|---|---|
| private String entityName | |
| id | back to summary |
|---|---|
| private Serializable id | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| LOG | back to summary |
|---|---|
| private static final CoreMessageLogger LOG | |
| readOnly | back to summary |
|---|---|
| private boolean readOnly | |
| readOnlyBeforeAttachedToSession | back to summary |
|---|---|
| private Boolean readOnlyBeforeAttachedToSession | |
| session | back to summary |
|---|---|
| private transient SharedSessionContractImplementor session | |
| sessionFactoryUuid | back to summary |
|---|---|
| private String sessionFactoryUuid | |
| target | back to summary |
|---|---|
| private Object target | |
| unwrap | back to summary |
|---|---|
| private boolean unwrap | |
| AbstractLazyInitializer | back to summary |
|---|---|
| protected AbstractLazyInitializer()
Deprecated This constructor was initially intended for serialization only, and is not useful anymore.
In any case it should not be relied on by user code.
Subclasses should rather implement Serializable with an
| |
| AbstractLazyInitializer | back to summary |
|---|---|
| protected AbstractLazyInitializer(String entityName, Serializable id, SharedSessionContractImplementor session) Main constructor.
| |
| afterDeserialization | back to summary |
|---|---|
| pack-priv final void afterDeserialization(Boolean readOnlyBeforeAttachedToSession, String sessionFactoryUuid, boolean allowLoadOutsideTransaction) Restore settings that are not passed to the constructor, but are still preserved during serialization. This method should only be called during deserialization, before associating the proxy with a session.
| |
| checkTargetState | back to summary |
|---|---|
| private void checkTargetState(SharedSessionContractImplementor session) | |
| errorIfReadOnlySettingNotAvailable | back to summary |
|---|---|
| private void errorIfReadOnlySettingNotAvailable() | |
| generateEntityKeyOrNull | back to summary |
|---|---|
| private static EntityKey generateEntityKeyOrNull(Serializable id, SharedSessionContractImplementor s, String entityName) | |
| getEntityName | back to summary |
|---|---|
| public final String getEntityName() Implements org. Doc from org. The entity-name of the entity our owning proxy represents. | |
| getIdentifier | back to summary |
|---|---|
| public final Serializable getIdentifier() Implements org. Doc from org. Retrieve the identifier value for the entity our owning proxy represents. When JPA proxy compliance is enabled the proxy is initialized.
| |
| getImplementation | back to summary |
|---|---|
| public final Object getImplementation() Implements org. Doc from org. Return the underlying persistent object, initializing if necessary | |
| getImplementation | back to summary |
|---|---|
| public final Object getImplementation(SharedSessionContractImplementor s) throws HibernateException Implements org. Doc from org. Return the underlying persistent object in the given session, or null if not contained in this session's persistence context.
| |
| getInternalIdentifier | back to summary |
|---|---|
| public final Serializable getInternalIdentifier() Overrides default org. Doc from org. Retrieve the identifier value for the entity our owning proxy represents.
| |
| getProxyOrNull | back to summary |
|---|---|
| private Object getProxyOrNull() | |
| getSession | back to summary |
|---|---|
| public final SharedSessionContractImplementor getSession() Implements org. Doc from org. Get the session to which this proxy is associated, or null if it is not attached.
| |
| getSessionFactoryUuid | back to summary |
|---|---|
| protected String getSessionFactoryUuid() Get the session factory UUID.
This method should only be called during serialization,
and only makes sense after a call to
| |
| getTarget | back to summary |
|---|---|
| protected final Object getTarget() Getter for property 'target'.
Same as
| |
| initialize | back to summary |
|---|---|
| public final void initialize() throws HibernateException Implements org. Doc from org. Initialize the proxy, fetching the target entity if necessary.
| |
| initializeWithoutLoadIfPossible | back to summary |
|---|---|
| public final void initializeWithoutLoadIfPossible() Attempt to initialize the proxy without loading anything from the database. This will only have any effect if the proxy is still attached to a session, and the entity being proxied has been loaded and added to the persistence context of that session since the proxy was created. | |
| isAllowLoadOutsideTransaction | back to summary |
|---|---|
| protected boolean isAllowLoadOutsideTransaction() Get whether the proxy can load data even
if it's not attached to a session with an ongoing transaction.
This method should only be called during serialization,
and only makes sense after a call to
| |
| isConnectedToSession | back to summary |
|---|---|
| protected final boolean isConnectedToSession() Getter for property 'connectedToSession'.
| |
| isInitializeProxyWhenAccessingIdentifier | back to summary |
|---|---|
| private boolean isInitializeProxyWhenAccessingIdentifier() | |
| isReadOnly | back to summary |
|---|---|
| public final boolean isReadOnly() Implements org. Doc from org. 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:
| |
| isReadOnlyBeforeAttachedToSession | back to summary |
|---|---|
| public final Boolean isReadOnlyBeforeAttachedToSession() 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)
| |
| isReadOnlySettingAvailable | back to summary |
|---|---|
| public final boolean isReadOnlySettingAvailable() Implements org. Doc from org. Is the proxy's read-only/modifiable setting available?
| |
| isUninitialized | back to summary |
|---|---|
| public final boolean isUninitialized() Implements org. Doc from org. Is the proxy uninitialized?
| |
| isUnwrap | back to summary |
|---|---|
| public boolean isUnwrap() Implements org.
| |
| permissiveInitialization | back to summary |
|---|---|
| protected void permissiveInitialization() | |
| prepareForPossibleLoadingOutsideTransaction | back to summary |
|---|---|
| protected void prepareForPossibleLoadingOutsideTransaction() Initialize internal state based on the currently attached session,
in order to be ready to load data even after the proxy is detached from the session.
This method only has any effect if
| |
| setIdentifier | back to summary |
|---|---|
| public final void setIdentifier(Serializable id) Implements org. Doc from org. Set the identifier value for the entity our owning proxy represents.
| |
| setImplementation | back to summary |
|---|---|
| public final void setImplementation(Object target) Implements org. Doc from org. Initialize the proxy manually by injecting its target. | |
| setReadOnly | back to summary |
|---|---|
| public final void setReadOnly(boolean readOnly) Implements org. Doc from org. 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.
| |
| setSession | back to summary |
|---|---|
| public final void setSession(SharedSessionContractImplementor s) throws HibernateException Implements org. Doc from org. 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 symmetry of the association. That must be done separately 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 context.
| |
| setUnwrap | back to summary |
|---|---|
| public void setUnwrap(boolean unwrap) Implements org.
| |
| unsetSession | back to summary |
|---|---|
| public final void unsetSession() Implements org. Doc from org. 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 during
| |