org.hibernate.proxy

Interface LazyInitializer

Known Implementing Classes:
AbstractLazyInitializer, BasicLazyInitializer, CGLIBLazyInitializer, Dom4jLazyInitializer, JavassistLazyInitializer, MapLazyInitializer

public interface LazyInitializer

Handles fetching of the underlying entity for a proxy
Author:
Gavin King

Method Summary

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

Method Details

getEntityName

public abstract String getEntityName()
Get the entity name

getIdentifier

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

getImplementation

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

getImplementation

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

getPersistentClass

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

getSession

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

initialize

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

isUninitialized

public abstract boolean isUninitialized()
Is the proxy uninitialzed?

isUnwrap

public boolean isUnwrap()

setIdentifier

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

setImplementation

public abstract void setImplementation(Object target)
Initialize the proxy manually

setSession

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

setUnwrap

public void setUnwrap(boolean unwrap)