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.
| Modifier and Type | Method and Description |
|---|---|
| public void | initialize(AbstractSession
the session to initialize against session)PUBLIC: Required: Lets the policy perform initialization. |
| public boolean | |
| public boolean | |
| 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 objectthe 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. |
| initialize | back to summary |
|---|---|
| public void initialize(AbstractSession session) throws DescriptorException PUBLIC: Required: Lets the policy perform initialization.
| |
| isTraversable | back 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. | |
| isWrapped | back to summary |
|---|---|
| public boolean isWrapped(Object object) PUBLIC: Required: Return true if the object is already wrapped. | |
| setDescriptor | back to summary |
|---|---|
| public void setDescriptor(ClassDescriptor descriptor) PUBLIC: Required: Set the descriptor.
| |
| unwrapObject | back 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.
| |
| wrapObject | back 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.
| |