Class SerializedObjectPolicyWrapper
- java.lang.Object
-
- org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy
-
- org.eclipse.persistence.internal.descriptors.SerializedObjectPolicyWrapper
-
- All Implemented Interfaces:
Serializable
,Cloneable
,SerializedObjectPolicy
public class SerializedObjectPolicyWrapper extends AbstractSerializedObjectPolicy
It's a transition class that holds SerializedObjectPolicy class name and field obtained from matadata before it can be instantiated.- Since:
- EclipseLink 2.5.1
- Author:
- Andrei Ilitchev
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
serializedObjectPolicyClassName
-
Fields inherited from class org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy
descriptor, field
-
-
Constructor Summary
Constructors Constructor Description SerializedObjectPolicyWrapper(String serializedObjectPolicyClassName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SerializedObjectPolicyWrapper
clone()
List<DatabaseField>
getAllSelectionFields()
Lists the database fields that should be read by the query using the policy, in case all inherited objects are read using outer joining.Object
getObjectFromRow(AbstractRecord databaseRow, AbstractSession session, ObjectLevelReadQuery query)
Deserialize the object from the value corresponding to the policy field, nullify that value, set the object into the row using setSopObject, also return it.List<DatabaseField>
getSelectionFields()
Lists the database fields that should be read by the query using the policy.String
getSerializedObjectPolicyClassName()
void
initialize(AbstractSession session)
initialize the policyvoid
initializeField(AbstractSession session)
unless the field is already initialized by parent descriptor, add the field to the owning descriptor and set field's typeSerializedObjectPolicy
instantiateChild()
instantiate policy for child descriptorvoid
postInitialize(AbstractSession session)
postinitialize the policy: determine which mappings are included, which fields should be selectedvoid
putObjectIntoRow(AbstractRecord databaseRow, Object object, AbstractSession session)
Serialize the object and put the result into the row as a value corresponding to the policy field-
Methods inherited from class org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy
getDescriptor, getField, setDescriptor, setField
-
-
-
-
Field Detail
-
serializedObjectPolicyClassName
protected String serializedObjectPolicyClassName
-
-
Constructor Detail
-
SerializedObjectPolicyWrapper
public SerializedObjectPolicyWrapper(String serializedObjectPolicyClassName)
-
-
Method Detail
-
getSerializedObjectPolicyClassName
public String getSerializedObjectPolicyClassName()
-
clone
public SerializedObjectPolicyWrapper clone()
- Specified by:
clone
in interfaceSerializedObjectPolicy
- Overrides:
clone
in classAbstractSerializedObjectPolicy
-
instantiateChild
public SerializedObjectPolicy instantiateChild()
Description copied from interface:SerializedObjectPolicy
instantiate policy for child descriptor
-
initializeField
public void initializeField(AbstractSession session)
Description copied from interface:SerializedObjectPolicy
unless the field is already initialized by parent descriptor, add the field to the owning descriptor and set field's type- Specified by:
initializeField
in interfaceSerializedObjectPolicy
- Overrides:
initializeField
in classAbstractSerializedObjectPolicy
-
initialize
public void initialize(AbstractSession session)
Description copied from interface:SerializedObjectPolicy
initialize the policy
-
postInitialize
public void postInitialize(AbstractSession session)
Description copied from interface:SerializedObjectPolicy
postinitialize the policy: determine which mappings are included, which fields should be selected
-
putObjectIntoRow
public void putObjectIntoRow(AbstractRecord databaseRow, Object object, AbstractSession session)
Description copied from interface:SerializedObjectPolicy
Serialize the object and put the result into the row as a value corresponding to the policy field
-
getObjectFromRow
public Object getObjectFromRow(AbstractRecord databaseRow, AbstractSession session, ObjectLevelReadQuery query)
Description copied from interface:SerializedObjectPolicy
Deserialize the object from the value corresponding to the policy field, nullify that value, set the object into the row using setSopObject, also return it. If the object is null or invalid, behaviour depend on whether the policy allows the query to recover or not (see comments to getFieldsToSelect and getAllFieldsToSelect methods): if recovery is possible then the method should return null, otherwise throw QueryException (query is a parameter of this method only because it's required by QueryException).
-
getSelectionFields
public List<DatabaseField> getSelectionFields()
Description copied from interface:SerializedObjectPolicy
Lists the database fields that should be read by the query using the policy. To allow recovery in case of null or invalid sopObject, then this method should return all the fields define by descriptor (descriptor.getFields()).
-
getAllSelectionFields
public List<DatabaseField> getAllSelectionFields()
Description copied from interface:SerializedObjectPolicy
Lists the database fields that should be read by the query using the policy, in case all inherited objects are read using outer joining. To allow recovery in case of null or invalid sopObject, then this method should return all the fields define by descriptor (descriptor.getAllFields()).
-
-