javax.jdo.annotations
Annotation Type Persistent


@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface Persistent

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

Since:
2.1
Version:
2.1

Optional Element Summary
 java.lang.String cacheable
          Whether this field/property is cacheable in a Level2 cache.
 java.lang.String column
          Column name where the values are stored for this member.
 Column[] columns
          Column definition(s) for this member.
 java.lang.String customValueStrategy
          Custom value strategy to use to generate the value for this field or property (if any).
 java.lang.String defaultFetchGroup
          Whether this member is in the default fetch group.
 java.lang.String dependent
          Whether related object(s) of this member are dependent and so deleted when this object is deleted.
 java.lang.String dependentElement
          Whether the elements of this member are dependent.
 java.lang.String dependentKey
          Whether the keys of this member are dependent.
 java.lang.String dependentValue
          Whether the values of this member are dependent.
 java.lang.String embedded
          Whether this member is embedded.
 java.lang.String embeddedElement
          Whether the elements of this member are embedded.
 java.lang.String embeddedKey
          Whether the keys of this member are embedded.
 java.lang.String embeddedValue
          Whether the values of this member are embedded.
 Extension[] extensions
          Vendor extensions for this member.
 java.lang.String loadFetchGroup
          Name of the fetch-group to use when this member is loaded due to being referenced when not already loaded.
 java.lang.String mappedBy
          Name of the related member in the other class where this value is mapped (bidirectional relationship).
 java.lang.String name
          Name of the member when this is embedded in another object.
 java.lang.String nullIndicatorColumn
          Null indicator column for this member.
 NullValue nullValue
          Behavior when this member contains a null value.
 PersistenceModifier persistenceModifier
          Modifier for this field.
 java.lang.String primaryKey
          Whether this member is part of the primary key for application identity.
 int recursionDepth
          Recursion depth for this member.
 java.lang.String sequence
          Name of the sequence to use with particular value strategies.
 java.lang.String serialized
          Whether this member is serialized into a single column.
 java.lang.String serializedElement
          Whether the elements of this member are serialized.
 java.lang.String serializedKey
          Whether the keys of this member are serialized.
 java.lang.String serializedValue
          Whether the values of this member are serialized.
 java.lang.String table
          Table to use for persisting this member.
 java.lang.Class[] types
          Types of the member.
 IdGeneratorStrategy valueStrategy
          Value strategy to use to generate the value for this field or property (if any).
 

persistenceModifier

public abstract PersistenceModifier persistenceModifier
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:
javax.jdo.annotations.PersistenceModifier.UNSPECIFIED

table

public abstract java.lang.String table
Table to use for persisting this member.

Returns:
the table to use for persisting this member
Default:
""

defaultFetchGroup

public abstract java.lang.String defaultFetchGroup
Whether this member is in the default fetch group.

Returns:
whether this member is in the default fetch group
Default:
""

nullValue

public abstract NullValue nullValue
Behavior when this member contains a null value.

Returns:
the behavior when this member contains a null value
Default:
javax.jdo.annotations.NullValue.NONE

embedded

public abstract java.lang.String embedded
Whether this member is embedded.

Returns:
whether this member is embedded
Default:
""

embeddedElement

public abstract java.lang.String embeddedElement
Whether the elements of this member are embedded.

Returns:
whether the elements of this member are embedded
Default:
""

embeddedKey

public abstract java.lang.String embeddedKey
Whether the keys of this member are embedded.

Returns:
whether the keys of this member are embedded
Default:
""

embeddedValue

public abstract java.lang.String embeddedValue
Whether the values of this member are embedded.

Returns:
whether the values of this member are embedded
Default:
""

serialized

public abstract java.lang.String serialized
Whether this member is serialized into a single column.

Returns:
whether this member is serialized into a single column
Default:
""

serializedElement

public abstract java.lang.String serializedElement
Whether the elements of this member are serialized.

Returns:
whether the elements of this member are serialized
Default:
""

serializedKey

public abstract java.lang.String serializedKey
Whether the keys of this member are serialized.

Returns:
whether the keys of this member are serialized
Default:
""

serializedValue

public abstract java.lang.String serializedValue
Whether the values of this member are serialized.

Returns:
whether the values of this member are serialized
Default:
""

dependent

public abstract java.lang.String dependent
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:
""

dependentElement

public abstract java.lang.String dependentElement
Whether the elements of this member are dependent.

Returns:
whether the elements of this member are dependent
Default:
""

dependentKey

public abstract java.lang.String dependentKey
Whether the keys of this member are dependent.

Returns:
whether the keys of this member are dependent
Default:
""

dependentValue

public abstract java.lang.String dependentValue
Whether the values of this member are dependent.

Returns:
whether the values of this member are dependent
Default:
""

primaryKey

public abstract java.lang.String primaryKey
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:
""

valueStrategy

public abstract IdGeneratorStrategy valueStrategy
Value strategy to use to generate the value for this field or property (if any).

Returns:
the generated value strategy
Default:
javax.jdo.annotations.IdGeneratorStrategy.UNSPECIFIED

customValueStrategy

public abstract java.lang.String customValueStrategy
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:
""

sequence

public abstract java.lang.String sequence
Name of the sequence to use with particular value strategies.

Returns:
the name of the sequence
Default:
""

loadFetchGroup

public abstract java.lang.String loadFetchGroup
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:
""

types

public abstract java.lang.Class[] types
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:
{}

mappedBy

public abstract java.lang.String mappedBy
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:
""

columns

public abstract Column[] columns
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:
{}

column

public abstract java.lang.String column
Column name where the values are stored for this member.

Returns:
the name of the column
Default:
""

nullIndicatorColumn

public abstract java.lang.String nullIndicatorColumn
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:
""

name

public abstract java.lang.String name
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:
""

recursionDepth

public abstract int recursionDepth
Recursion depth for this member. Used only when the annotation is used within the definition of a FetchGroup.

Returns:
the recursion depth
Default:
1

cacheable

public abstract java.lang.String cacheable
Whether this field/property is cacheable in a Level2 cache.

Since:
2.2
Default:
"true"

extensions

public abstract Extension[] extensions
Vendor extensions for this member.

Returns:
the vendor extensions
Default:
{}


Copyright © 2005-2010 Apache Software Foundation. All Rights Reserved.