JDO Annotation

Persistent

Target: ElementType.FIELD, ElementType.METHOD
Implemented Interfaces:
Annotation

Annotation for defining the persistence of a member. This corresponds to the xml elements "field" and "property".
Since:
JDO 2.1

Public Annotation Attributes

String cacheable default "true"
Whether this field/property is cacheable in a Level2 cache.
Since:
JDO 2.2
String column default ""
Column name where the values are stored for this member.
Since:
JDO 2.1
Column[] columns default {}
Column definition(s) for this member.
Used for mapping multiple columns to the same member, for example relationships with multiple column foreign keys.
Since:
JDO 2.1
String customValueStrategy default ""
Custom value strategy to use to generate the value for this field or property (if any).
If customValueStrategy is non-empty, then valueStrategy must be UNSPECIFIED.
Since:
JDO 2.1
String defaultFetchGroup default ""
Whether this member is in the default fetch group.
Since:
JDO 2.1
String dependent default ""
Whether related object(s) of this member are dependent and so deleted when this object is deleted.
Since:
JDO 2.1
String dependentElement default ""
Whether the elements of this member are dependent.
Since:
JDO 2.1
String dependentKey default ""
Whether the keys of this member are dependent.
Since:
JDO 2.1
String dependentValue default ""
Whether the values of this member are dependent.
Since:
JDO 2.1
String embedded default ""
Whether this member is embedded.
Since:
JDO 2.1
String embeddedElement default ""
Whether the elements of this member are embedded.
Since:
JDO 2.1
String embeddedKey default ""
Whether the keys of this member are embedded.
Since:
JDO 2.1
String embeddedValue default ""
Whether the values of this member are embedded.
Since:
JDO 2.1
Extension[] extensions default {}
Vendor extensions for this member.
Since:
JDO 2.1
String loadFetchGroup default ""
Name of the fetch-group to use when this member is loaded due to being referenced when not already loaded.
Since:
JDO 2.1
String mappedBy default ""
Name of the related member in the other class where this value is mapped (bidirectional relationship).
Since:
JDO 2.1
String name default ""
Name of the member when this is embedded in another object.
The fully-qualified member name is used. For example, "line.point1.x" refers to the member x in class Point that is embedded as member point1 in class Line that is embedded in a member called line.
Since:
JDO 2.1
String nullIndicatorColumn default ""
Null indicator column for this member.
Used for nested embedded fields or properties to indicate whether the embedded instance should have a null value.
Since:
JDO 2.1
NullValue nullValue default NullValue.NONE
Behavior when this member contains a null value.
Since:
JDO 2.1
PersistenceModifier persistenceModifier default PersistenceModifier.UNSPECIFIED
Modifier for this field.
This is normally not specified, and the defaults are used, or the @Transactional or @NotPersistent annotation is specified directly on the member. One possible use for specifying persistenceModifier is for embedded instances in which a member is not persistent but in the non-embedded instances the member is persistent. Note that it is not portable to specify a member to be not persistent in the non-embedded case and persistent in the embedded usage.
Since:
JDO 2.1
String primaryKey default ""
Whether this member is part of the primary key for application identity.
This is equivalent to specifying @PrimaryKey as a separate annotation on the member.
Since:
JDO 2.1
int recursionDepth default 1
Recursion depth for this member.
Used only when the annotation is used within the definition of a FetchGroup.
Since:
JDO 2.1
String sequence default ""
Name of the sequence to use with particular value strategies.
Since:
JDO 2.1
String serialized default ""
Whether this member is serialized into a single column.
Since:
JDO 2.1
String serializedElement default ""
Whether the elements of this member are serialized.
Since:
JDO 2.1
String serializedKey default ""
Whether the keys of this member are serialized.
Since:
JDO 2.1
String serializedValue default ""
Whether the values of this member are serialized.
Since:
JDO 2.1
String table default ""
Table to use for persisting this member.
Since:
JDO 2.1
Class[] types default {}
Types of the member.
Used when the declared member type is a supertype of the actual type that is stored in the member. For example, the declared member type might be an interface type that must contain an object of a concrete type when used for persistence.
Since:
JDO 2.1
IdGeneratorStrategy valueStrategy default IdGeneratorStrategy.UNSPECIFIED
Value strategy to use to generate the value for this field or property (if any).
Since:
JDO 2.1