|
EclipseLink 2.5.3, build 'v20180808-e38c757' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SerializedObjectPolicy
SerializedObjectPolicy (SOP) could be set on a non-aggregate descriptor. If SerializedObjectPolicy is specified Eclipselink writes out the whole entity object with its privately owned (and nested privately owned) entities and element collections into an additional (likely BLOB) field in the database. If SerializedObjectPolicy is set on an entity then SerializedObjectPolicies with the same field are set on all inheriting entities. The goal is to make reads from the database faster. The draw back is slower writes into the database. So SerializedObjectPolicy may make sense for read-only / read-mostly application for Entity, which always loads all its dependent entities and / or ElementCollections. To use SerializedObjectPolicy, ObjectLevelReadQuery should set a boolean flag
In case the serialized object column contains null or obsolete version of the object
the query using SerializedObjectPolicy would either throw exception or - if all other fields have been read, too -
would build the object using these fields (exactly as in case SerializedObjectPolicy is not used).
Note that currently no default implementation of SerializedObjectPolicy is available
and this class should be provided by the user.,
SerializedObject| Method Summary | |
|---|---|
SerializedObjectPolicy |
clone()
|
java.util.List<org.eclipse.persistence.internal.helper.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. |
ClassDescriptor |
getDescriptor()
get owning descriptor |
org.eclipse.persistence.internal.helper.DatabaseField |
getField()
get the field that stores sopObject in the database (sopField) |
java.lang.Object |
getObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.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. |
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> |
getSelectionFields()
Lists the database fields that should be read by the query using the policy. |
void |
initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
initialize the policy |
void |
initializeField(org.eclipse.persistence.internal.sessions.AbstractSession session)
unless the field is already initialized by parent descriptor, add the field to the owning descriptor and set field's type |
SerializedObjectPolicy |
instantiateChild()
instantiate policy for child descriptor |
void |
postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
postinitialize the policy: determine which mappings are included, which fields should be selected |
void |
putObjectIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
Serialize the object and put the result into the row as a value corresponding to the policy field |
void |
setDescriptor(ClassDescriptor descriptor)
set owning descriptor |
void |
setField(org.eclipse.persistence.internal.helper.DatabaseField field)
set the field that stores sopObject in the database (sopField) |
| Method Detail |
|---|
ClassDescriptor getDescriptor()
void setDescriptor(ClassDescriptor descriptor)
org.eclipse.persistence.internal.helper.DatabaseField getField()
void setField(org.eclipse.persistence.internal.helper.DatabaseField field)
SerializedObjectPolicy clone()
SerializedObjectPolicy instantiateChild()
void initializeField(org.eclipse.persistence.internal.sessions.AbstractSession session)
void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
void postInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getSelectionFields()
java.util.List<org.eclipse.persistence.internal.helper.DatabaseField> getAllSelectionFields()
void putObjectIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
java.lang.Object object,
org.eclipse.persistence.internal.sessions.AbstractSession session)
java.lang.Object getObjectFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord databaseRow,
org.eclipse.persistence.internal.sessions.AbstractSession session,
ObjectLevelReadQuery query)
|
EclipseLink 2.5.3, build 'v20180808-e38c757' API Reference | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||