|
|||||||||
| Home >> All >> org >> hibernate >> [ proxy overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.hibernate.proxy
Class AbstractLazyInitializer

java.lang.Objectorg.hibernate.proxy.AbstractLazyInitializer
- All Implemented Interfaces:
- LazyInitializer
- Direct Known Subclasses:
- BasicLazyInitializer, Dom4jLazyInitializer, MapLazyInitializer
- public abstract class AbstractLazyInitializer
- extends java.lang.Object
- implements LazyInitializer
- extends java.lang.Object
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.
| Field Summary | |
private java.lang.String |
entityName
|
private java.io.Serializable |
id
|
private boolean |
initialized
|
private org.hibernate.engine.SessionImplementor |
session
|
private java.lang.Object |
target
|
private boolean |
unwrap
|
| Constructor Summary | |
protected |
AbstractLazyInitializer(java.lang.String entityName,
java.io.Serializable id,
org.hibernate.engine.SessionImplementor session)
|
| Method Summary | |
private void |
checkTargetState()
|
java.lang.String |
getEntityName()
Get the entity name |
java.io.Serializable |
getIdentifier()
Get the identifier held by the proxy |
java.lang.Object |
getImplementation()
Return the underlying persistent object, initializing if necessary |
java.lang.Object |
getImplementation(org.hibernate.engine.SessionImplementor s)
Return the underlying persistent object in the given Session, or null, do not initialize the proxy |
org.hibernate.engine.SessionImplementor |
getSession()
Get the session, if this proxy is attached |
protected java.lang.Object |
getTarget()
|
void |
initialize()
Initialize the proxy, fetching the target entity if necessary |
protected boolean |
isConnectedToSession()
|
boolean |
isUninitialized()
Is the proxy uninitialzed? |
boolean |
isUnwrap()
|
void |
setIdentifier(java.io.Serializable id)
Set the identifier property of the proxy |
void |
setImplementation(java.lang.Object target)
Initialize the proxy manually |
void |
setSession(org.hibernate.engine.SessionImplementor s)
Attach the proxy to a session |
void |
setUnwrap(boolean unwrap)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.hibernate.proxy.LazyInitializer |
getPersistentClass |
| Field Detail |
target
private java.lang.Object target
initialized
private boolean initialized
entityName
private java.lang.String entityName
id
private java.io.Serializable id
session
private transient org.hibernate.engine.SessionImplementor session
unwrap
private boolean unwrap
| Constructor Detail |
AbstractLazyInitializer
protected AbstractLazyInitializer(java.lang.String entityName, java.io.Serializable id, org.hibernate.engine.SessionImplementor session)
| Method Detail |
getIdentifier
public final java.io.Serializable getIdentifier()
- Description copied from interface:
LazyInitializer - Get the identifier held by the proxy
- Specified by:
getIdentifierin interfaceLazyInitializer
setIdentifier
public final void setIdentifier(java.io.Serializable id)
- Description copied from interface:
LazyInitializer - Set the identifier property of the proxy
- Specified by:
setIdentifierin interfaceLazyInitializer
getEntityName
public final java.lang.String getEntityName()
- Description copied from interface:
LazyInitializer - Get the entity name
- Specified by:
getEntityNamein interfaceLazyInitializer
isUninitialized
public final boolean isUninitialized()
- Description copied from interface:
LazyInitializer - Is the proxy uninitialzed?
- Specified by:
isUninitializedin interfaceLazyInitializer
getSession
public final org.hibernate.engine.SessionImplementor getSession()
- Description copied from interface:
LazyInitializer - Get the session, if this proxy is attached
- Specified by:
getSessionin interfaceLazyInitializer
initialize
public final void initialize()
throws org.hibernate.HibernateException
- Description copied from interface:
LazyInitializer - Initialize the proxy, fetching the target
entity if necessary
- Specified by:
initializein interfaceLazyInitializer
checkTargetState
private void checkTargetState()
setSession
public final void setSession(org.hibernate.engine.SessionImplementor s) throws org.hibernate.HibernateException
- Description copied from interface:
LazyInitializer - Attach the proxy to a session
- Specified by:
setSessionin interfaceLazyInitializer
isConnectedToSession
protected final boolean isConnectedToSession()
setImplementation
public final void setImplementation(java.lang.Object target)
- Description copied from interface:
LazyInitializer - Initialize the proxy manually
- Specified by:
setImplementationin interfaceLazyInitializer
getImplementation
public final java.lang.Object getImplementation()
- Return the underlying persistent object, initializing if necessary
- Specified by:
getImplementationin interfaceLazyInitializer
getImplementation
public final java.lang.Object getImplementation(org.hibernate.engine.SessionImplementor s) throws org.hibernate.HibernateException
- Return the underlying persistent object in the given Session, or null,
do not initialize the proxy
- Specified by:
getImplementationin interfaceLazyInitializer
getTarget
protected final java.lang.Object getTarget()
isUnwrap
public boolean isUnwrap()
- Specified by:
isUnwrapin interfaceLazyInitializer
setUnwrap
public void setUnwrap(boolean unwrap)
- Specified by:
setUnwrapin interfaceLazyInitializer
|
|||||||||
| Home >> All >> org >> hibernate >> [ proxy overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.hibernate.proxy.AbstractLazyInitializer