@Target(value=TYPE)
@Retention(value=RUNTIME)
public @interface SerializedObject
Examples:
Examples:
Query query = em.createQuery("SELECT e FROM Employee e").setHint(QueryHints.SERIALIZED_OBJECT, "true");
Map hints = new HashMap();
hints.put("eclipselink.serialized-object", "true");
Address address = em.find(Address.class, id, hints);
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.
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.descriptors.SerializedObject
,
SerializedObjectPolicy
Modifier and Type | Required Element and Description |
---|---|
java.lang.Class |
value
The Class that implements org.eclipse.persistence.descriptors.SerializedObjectPolicy interface.
|
public abstract java.lang.Class value
public abstract Column column