javax.jdo.annotations.Persistent - JDO annotation

javax.jdo.annotations
Annotation Persistent

Target:
Fields (including property get methods)
Annotation for defining the persistence of a member. This corresponds to the xml elements "field" and "property".
Since:
JDO 2.1
String cacheable
Whether this field/property is cacheable in a Level2 cache.
Whether this field/property is cacheable in a Level2 cache.
Default value:
"true"
Since:
JDO 2.2
String column
Column name where the values are stored for this member.
Column name where the values are stored for this member.
Returns:
the name of the column
Default value:
""
Since:
JDO 2.1
Column definition(s) for this member.
Column definition(s) for this member. Used for mapping multiple columns to the same member, for example relationships with multiple column foreign keys.
Returns:
the columns for this member
Default value:
{}
Since:
JDO 2.1
Custom value strategy to use to generate the value for this field or property (if any).
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.
Returns:
the custom value strategy
Default value:
""
Since:
JDO 2.1
Whether this member is in the default fetch group.
Whether this member is in the default fetch group.
Returns:
whether this member is in the default fetch group
Default value:
""
Since:
JDO 2.1
String dependent
Whether related object(s) of this member are dependent and so deleted when this object is deleted.
Whether related object(s) of this member are dependent and so deleted when this object is deleted.
Returns:
whether the related object(s) of this member are dependent
Default value:
""
Since:
JDO 2.1
Whether the elements of this member are dependent.
Whether the elements of this member are dependent.
Returns:
whether the elements of this member are dependent
Default value:
""
Since:
JDO 2.1
String dependentKey
Whether the keys of this member are dependent.
Whether the keys of this member are dependent.
Returns:
whether the keys of this member are dependent
Default value:
""
Since:
JDO 2.1
Whether the values of this member are dependent.
Whether the values of this member are dependent.
Returns:
whether the values of this member are dependent
Default value:
""
Since:
JDO 2.1
String embedded
Whether this member is embedded.
Whether this member is embedded.
Returns:
whether this member is embedded
Default value:
""
Since:
JDO 2.1
Whether the elements of this member are embedded.
Whether the elements of this member are embedded.
Returns:
whether the elements of this member are embedded
Default value:
""
Since:
JDO 2.1
String embeddedKey
Whether the keys of this member are embedded.
Whether the keys of this member are embedded.
Returns:
whether the keys of this member are embedded
Default value:
""
Since:
JDO 2.1
String embeddedValue
Whether the values of this member are embedded.
Whether the values of this member are embedded.
Returns:
whether the values of this member are embedded
Default value:
""
Since:
JDO 2.1
Vendor extensions for this member.
Vendor extensions for this member.
Returns:
the vendor extensions
Default value:
{}
Since:
JDO 2.1
Name of the fetch-group to use when this member is loaded due to being referenced when not already loaded.
Name of the fetch-group to use when this member is loaded due to being referenced when not already loaded.
Returns:
the name of the load fetch group
Default value:
""
Since:
JDO 2.1
String mappedBy
Name of the related member in the other class where this value is mapped (bidirectional relationship).
Name of the related member in the other class where this value is mapped (bidirectional relationship).
Returns:
the related member in the other class
Default value:
""
Since:
JDO 2.1
String name
Name of the member when this is embedded in another object.
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.
Returns:
the name of the member
Default value:
""
Since:
JDO 2.1
Null indicator column for this member.
Null indicator column for this member. Used for nested embedded fields or properties to indicate whether the embedded instance should have a null value.
Returns:
the null indicator column
Default value:
""
Since:
JDO 2.1
Behavior when this member contains a null value.
Behavior when this member contains a null value.
Returns:
the behavior when this member contains a null value
Default value:
javax.jdo.annotations.NullValue.NONE
Since:
JDO 2.1
Modifier for this field.
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.
Returns:
the persistence modifier
Default value:
javax.jdo.annotations.PersistenceModifier.UNSPECIFIED
Since:
JDO 2.1
String primaryKey
Whether this member is part of the primary key for application identity.
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.
Returns:
whether this member is part of the primary key
Default value:
""
Since:
JDO 2.1
Recursion depth for this member.
Recursion depth for this member. Used only when the annotation is used within the definition of a FetchGroup.
Returns:
the recursion depth
Default value:
1
Since:
JDO 2.1
String sequence
Name of the sequence to use with particular value strategies.
Name of the sequence to use with particular value strategies.
Returns:
the name of the sequence
Default value:
""
Since:
JDO 2.1
String serialized
Whether this member is serialized into a single column.
Whether this member is serialized into a single column.
Returns:
whether this member is serialized into a single column
Default value:
""
Since:
JDO 2.1
Whether the elements of this member are serialized.
Whether the elements of this member are serialized.
Returns:
whether the elements of this member are serialized
Default value:
""
Since:
JDO 2.1
String serializedKey
Whether the keys of this member are serialized.
Whether the keys of this member are serialized.
Returns:
whether the keys of this member are serialized
Default value:
""
Since:
JDO 2.1
Whether the values of this member are serialized.
Whether the values of this member are serialized.
Returns:
whether the values of this member are serialized
Default value:
""
Since:
JDO 2.1
String table
Table to use for persisting this member.
Table to use for persisting this member.
Returns:
the table to use for persisting this member
Default value:
""
Since:
JDO 2.1
Class[] types
Types of the member.
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.
Returns:
the types
Default value:
{}
Since:
JDO 2.1
Value strategy to use to generate the value for this field or property (if any).
Value strategy to use to generate the value for this field or property (if any).
Returns:
the generated value strategy
Default value:
javax.jdo.annotations.IdGeneratorStrategy.UNSPECIFIED
Since:
JDO 2.1

This documentation page is derived (with some adjustments) from the JDO 2.2 API
and is available under the terms of the Apache License, v. 2.0.