Top Description Fields Constructors Methods
org.eclipse.persistence.internal.descriptors

public Class SerializedObjectPolicyWrapper

extends AbstractSerializedObjectPolicy
Class Inheritance
Imports
java.util.List, org.eclipse.persistence.descriptors.SerializedObjectPolicy, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.queries.ObjectLevelReadQuery

It's a transition class that holds SerializedObjectPolicy class name and field obtained from matadata before it can be instantiated.
Author
Andrei Ilitchev
Since
EclipseLink 2.5.1

Field Summary

Modifier and TypeField and Description
protected String
Inherited from org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy:
descriptorfield

Constructor Summary

AccessConstructor and Description
public
SerializedObjectPolicyWrapper(String serializedObjectPolicyClassName)

Method Summary

Modifier and TypeMethod and Description
public SerializedObjectPolicyWrapper
public List<DatabaseField>
getAllSelectionFields()

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.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.
public Object
getObjectFromRow(AbstractRecord databaseRow, AbstractSession session, ObjectLevelReadQuery query)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.getObjectFromRow.

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.
public List<DatabaseField>
getSelectionFields()

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.getSelectionFields.

Lists the database fields that should be read by the query using the policy.
public String
public void
public void
initializeField(AbstractSession session)

Overrides org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy.initializeField.

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.initializeField.

unless the field is already initialized by parent descriptor, add the field to the owning descriptor and set field's type
public SerializedObjectPolicy
public void
postInitialize(AbstractSession session)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.postInitialize.

postinitialize the policy: determine which mappings are included, which fields should be selected
public void
putObjectIntoRow(AbstractRecord databaseRow, Object object, AbstractSession session)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.putObjectIntoRow.

Serialize the object and put the result into the row as a value corresponding to the policy field
Inherited from org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy:
getDescriptorgetFieldsetDescriptorsetField

Field Detail

serializedObjectPolicyClassNameback to summary
protected String serializedObjectPolicyClassName

Constructor Detail

SerializedObjectPolicyWrapperback to summary
public SerializedObjectPolicyWrapper(String serializedObjectPolicyClassName)

Method Detail

cloneback to summary
public SerializedObjectPolicyWrapper clone()

Overrides org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy.clone.

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:SerializedObjectPolicyWrapper

a clone of this instance.

Annotations
@Override
getAllSelectionFieldsback to summary
public List<DatabaseField> getAllSelectionFields()

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.getAllSelectionFields.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.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. To allow recovery in case of null or invalid sopObject, then this method should return all the fields define by descriptor (descriptor.getAllFields()).

Annotations
@Override
getObjectFromRowback to summary
public Object getObjectFromRow(AbstractRecord databaseRow, AbstractSession session, ObjectLevelReadQuery query)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.getObjectFromRow.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.getObjectFromRow.

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).

Annotations
@Override
getSelectionFieldsback to summary
public List<DatabaseField> getSelectionFields()

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.getSelectionFields.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.getSelectionFields.

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()).

Annotations
@Override
getSerializedObjectPolicyClassNameback to summary
public String getSerializedObjectPolicyClassName()
initializeback to summary
public void initialize(AbstractSession session)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.initialize.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.initialize.

initialize the policy

Annotations
@Override
initializeFieldback to summary
public void initializeField(AbstractSession session)

Overrides org.eclipse.persistence.internal.descriptors.AbstractSerializedObjectPolicy.initializeField.

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.initializeField.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.initializeField.

unless the field is already initialized by parent descriptor, add the field to the owning descriptor and set field's type

Annotations
@Override
instantiateChildback to summary
public SerializedObjectPolicy instantiateChild()

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.instantiateChild.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.instantiateChild.

instantiate policy for child descriptor

Annotations
@Override
postInitializeback to summary
public void postInitialize(AbstractSession session)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.postInitialize.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.postInitialize.

postinitialize the policy: determine which mappings are included, which fields should be selected

Annotations
@Override
putObjectIntoRowback to summary
public void putObjectIntoRow(AbstractRecord databaseRow, Object object, AbstractSession session)

Implements org.eclipse.persistence.descriptors.SerializedObjectPolicy.putObjectIntoRow.

Doc from org.eclipse.persistence.descriptors.SerializedObjectPolicy.putObjectIntoRow.

Serialize the object and put the result into the row as a value corresponding to the policy field

Annotations
@Override