Top Description Methods
org.eclipse.persistence.descriptors

public Interface WrapperPolicy

extends Serializable
Imports
java.io.Serializable, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.sessions.AbstractSession

Purpose: The wrapper policy can be used to wrap all objects read from the database in another object. This allows for EclipseLink to utilize one version of the class for its purposes and allows for the application to deal with another version of the object. The wrapper policy is used for things such as EJB Entity Beans and is directly used by the TopLink for WebLogic product for EJB Container Managed Persistence. It is assumed that relationships must be through the wrapper objects. Object identity is not maintained on the wrapper objects, only the wrapped object.

Method Summary

Modifier and TypeMethod and Description
public void
initialize(AbstractSession
the session to initialize against
session
)

PUBLIC: Required: Lets the policy perform initialization.

public boolean
isTraversable()

PUBLIC: Required: Return true if the wrapped value should be traversed.

public boolean
isWrapped(Object object)

PUBLIC: Required: Return true if the object is already wrapped.

public void
setDescriptor(ClassDescriptor
the descriptor for the object being wrapped
descriptor
)

PUBLIC: Required: Set the descriptor.

public Object
unwrapObject(Object
the wrapped object
proxy
,
AbstractSession
the session to unwrap into
session
)

PUBLIC: Required: Unwrap the object to return the implementation that is meant to be used by EclipseLink.

public Object

Returns:

java.lang.Object the wrapped object
wrapObject
(Object
the object to be wrapped
original
,
AbstractSession
the session to wrap the object against.
session
)

PUBLIC: Required: Wrap the object to return the implementation that the application requires.

Method Detail

initializeback to summary
public void initialize(AbstractSession session) throws DescriptorException

PUBLIC: Required: Lets the policy perform initialization.

Parameters
session:AbstractSession

the session to initialize against

isTraversableback to summary
public boolean isTraversable()

PUBLIC: Required: Return true if the wrapped value should be traversed. Normally the wrapped value is looked after independently, it is not required to be traversed.

isWrappedback to summary
public boolean isWrapped(Object object)

PUBLIC: Required: Return true if the object is already wrapped.

setDescriptorback to summary
public void setDescriptor(ClassDescriptor descriptor)

PUBLIC: Required: Set the descriptor.

Parameters
descriptor:ClassDescriptor

the descriptor for the object being wrapped

unwrapObjectback to summary
public Object unwrapObject(Object proxy, AbstractSession session)

PUBLIC: Required: Unwrap the object to return the implementation that is meant to be used by EclipseLink. The object may already be unwrapped in which case the object should be returned.

Parameters
proxy:Object

the wrapped object

session:AbstractSession

the session to unwrap into

wrapObjectback to summary
public Object wrapObject(Object original, AbstractSession session)

PUBLIC: Required: Wrap the object to return the implementation that the application requires. The object may already be wrapped in which case the object should be returned.

Parameters
original:Object

the object to be wrapped

session:AbstractSession

the session to wrap the object against.

Returns:Object

java.lang.Object the wrapped object