T
- entity class of this adapterpublic class ReferenceAdapterV2<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest> extends XmlAdapter<T,T>
Modifier and Type | Field and Description |
---|---|
protected PersistenceContext |
context |
Constructor and Description |
---|
ReferenceAdapterV2() |
ReferenceAdapterV2(PersistenceContext context)
Instantiates a new reference adapter.
|
Modifier and Type | Method and Description |
---|---|
T |
marshal(T o)
Marshal just passes through.
|
T |
unmarshal(T o)
If 'canonical' or 'self' link is present loads entity from the database.
|
protected PersistenceContext context
public ReferenceAdapterV2()
public ReferenceAdapterV2(PersistenceContext context)
context
- persistent context (mandatory)public T marshal(T o) throws java.lang.Exception
marshal
in class XmlAdapter<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest,T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>
o
- java.lang.Exception
public T unmarshal(T o) throws java.lang.Exception
unmarshal
in class XmlAdapter<T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest,T extends org.eclipse.persistence.internal.weaving.PersistenceWeavedRest>
o
- The value to be converted. Can be null.java.lang.Exception
- if there's an error during the conversion. The caller is responsible for
reporting the error to the user through ValidationEventHandler
.