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. , org.eclipse.persistence.annotations.SerializedObject
| Modifier and Type | Method and Description |
|---|---|
| public SerializedObjectPolicy | |
| public List | 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 ClassDescriptor | |
| public DatabaseField | |
| public 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. |
| public List | |
| public void | |
| public void | initializeField(AbstractSession session)
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)
postinitialize the policy: determine which mappings are included, which fields should be selected |
| public void | 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 |
| public void | |
| public void |
| clone | back to summary |
|---|---|
| public SerializedObjectPolicy clone() | |
| getAllSelectionFields | back to summary |
|---|---|
| public List 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()). | |
| getDescriptor | back to summary |
|---|---|
| public ClassDescriptor getDescriptor() get owning descriptor | |
| getField | back to summary |
|---|---|
| public DatabaseField getField() get the field that stores sopObject in the database (sopField) | |
| getObjectFromRow | back to summary |
|---|---|
| public 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. 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 | back to summary |
|---|---|
| public List 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()). | |
| initialize | back to summary |
|---|---|
| public void initialize(AbstractSession session) initialize the policy | |
| initializeField | back to summary |
|---|---|
| public void initializeField(AbstractSession session) unless the field is already initialized by parent descriptor, add the field to the owning descriptor and set field's type | |
| instantiateChild | back to summary |
|---|---|
| public SerializedObjectPolicy instantiateChild() instantiate policy for child descriptor | |
| postInitialize | back to summary |
|---|---|
| public void postInitialize(AbstractSession session) postinitialize the policy: determine which mappings are included, which fields should be selected | |
| putObjectIntoRow | back to summary |
|---|---|
| public void 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 | |
| setDescriptor | back to summary |
|---|---|
| public void setDescriptor(ClassDescriptor descriptor) set owning descriptor | |
| setField | back to summary |
|---|---|
| public void setField(DatabaseField field) set the field that stores sopObject in the database (sopField) | |