站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 3.2.4 正式版 API 英文文档

LazyInitializer (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档


org.hibernate.proxy
Interface LazyInitializer

All Known Implementing Classes:
AbstractLazyInitializer

public interface LazyInitializer

Handles fetching of the underlying entity for a proxy

Author:
Gavin King

Method Summary
 String getEntityName()
          Get the entity name
 Serializable getIdentifier()
          Get the identifier held by the proxy
 Object getImplementation()
          Return the underlying persistent object, initializing if necessary
 Object getImplementation(SessionImplementor s)
          Return the underlying persistent object in the given Session, or null
 Class getPersistentClass()
          Get the actual class of the entity (don't use this, use the entityName)
 SessionImplementor getSession()
          Get the session, if this proxy is attached
 void initialize()
          Initialize the proxy, fetching the target entity if necessary
 boolean isUninitialized()
          Is the proxy uninitialzed?
 boolean isUnwrap()
           
 void setIdentifier(Serializable id)
          Set the identifier property of the proxy
 void setImplementation(Object target)
          Initialize the proxy manually
 void setSession(SessionImplementor s)
          Attach the proxy to a session
 void setUnwrap(boolean unwrap)
           
 

Method Detail

initialize

public void initialize()
                throws HibernateException
Initialize the proxy, fetching the target entity if necessary

Throws:
HibernateException

getIdentifier

public Serializable getIdentifier()
Get the identifier held by the proxy


setIdentifier

public void setIdentifier(Serializable id)
Set the identifier property of the proxy


getEntityName

public String getEntityName()
Get the entity name


getPersistentClass

public Class getPersistentClass()
Get the actual class of the entity (don't use this, use the entityName)


isUninitialized

public boolean isUninitialized()
Is the proxy uninitialzed?


setImplementation

public void setImplementation(Object target)
Initialize the proxy manually


getSession

public SessionImplementor getSession()
Get the session, if this proxy is attached


setSession

public void setSession(SessionImplementor s)
                throws HibernateException
Attach the proxy to a session

Throws:
HibernateException

getImplementation

public Object getImplementation()
Return the underlying persistent object, initializing if necessary


getImplementation

public Object getImplementation(SessionImplementor s)
                         throws HibernateException
Return the underlying persistent object in the given Session, or null

Throws:
HibernateException

setUnwrap

public void setUnwrap(boolean unwrap)

isUnwrap

public boolean isUnwrap()