Annotation Type Persistent


  • @Target({FIELD,METHOD})
    @Retention(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

      Optional Elements 
      Modifier and Type Optional Element Description
      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).
    • Element Detail

      • persistenceModifier

        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

        java.lang.String table
        Table to use for persisting this member.
        Returns:
        the table to use for persisting this member
        Default:
        ""
      • defaultFetchGroup

        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

        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

        java.lang.String embedded
        Whether this member is embedded.
        Returns:
        whether this member is embedded
        Default:
        ""
      • embeddedElement

        java.lang.String embeddedElement
        Whether the elements of this member are embedded.
        Returns:
        whether the elements of this member are embedded
        Default:
        ""
      • embeddedKey

        java.lang.String embeddedKey
        Whether the keys of this member are embedded.
        Returns:
        whether the keys of this member are embedded
        Default:
        ""
      • embeddedValue

        java.lang.String embeddedValue
        Whether the values of this member are embedded.
        Returns:
        whether the values of this member are embedded
        Default:
        ""
      • serialized

        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

        java.lang.String serializedElement
        Whether the elements of this member are serialized.
        Returns:
        whether the elements of this member are serialized
        Default:
        ""
      • serializedKey

        java.lang.String serializedKey
        Whether the keys of this member are serialized.
        Returns:
        whether the keys of this member are serialized
        Default:
        ""
      • serializedValue

        java.lang.String serializedValue
        Whether the values of this member are serialized.
        Returns:
        whether the values of this member are serialized
        Default:
        ""
      • dependent

        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

        java.lang.String dependentElement
        Whether the elements of this member are dependent.
        Returns:
        whether the elements of this member are dependent
        Default:
        ""
      • dependentKey

        java.lang.String dependentKey
        Whether the keys of this member are dependent.
        Returns:
        whether the keys of this member are dependent
        Default:
        ""
      • dependentValue

        java.lang.String dependentValue
        Whether the values of this member are dependent.
        Returns:
        whether the values of this member are dependent
        Default:
        ""
      • primaryKey

        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

        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

        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

        java.lang.String sequence
        Name of the sequence to use with particular value strategies.
        Returns:
        the name of the sequence
        Default:
        ""
      • loadFetchGroup

        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

        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

        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

        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

        java.lang.String column
        Column name where the values are stored for this member.
        Returns:
        the name of the column
        Default:
        ""
      • nullIndicatorColumn

        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

        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

        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

        java.lang.String cacheable
        Whether this field/property is cacheable in a Level2 cache.
        Since:
        2.2
        Default:
        "true"
      • extensions

        Extension[] extensions
        Vendor extensions for this member.
        Returns:
        the vendor extensions
        Default:
        {}