javax.jdo.annotations

## Annotation Type Persistent

-     @Target(value={ANNOTATION_TYPE,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

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

- - ### Element Detail

    - #### 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 String table

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

  - - #### defaultFetchGroup

          public abstract 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 String embedded

      Whether this member is embedded.
      Returns:
        whether this member is embedded
      Default:
        ""

  - - #### embeddedElement

          public abstract String embeddedElement

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

  - - #### embeddedKey

          public abstract String embeddedKey

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

  - - #### embeddedValue

          public abstract String embeddedValue

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

  - - #### serialized

          public abstract 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 String serializedElement

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

  - - #### serializedKey

          public abstract String serializedKey

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

  - - #### serializedValue

          public abstract String serializedValue

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

  - - #### dependent

          public abstract 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 String dependentElement

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

  - - #### dependentKey

          public abstract String dependentKey

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

  - - #### dependentValue

          public abstract String dependentValue

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

  - - #### primaryKey

          public abstract 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 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 String sequence

      Name of the sequence to use with particular value strategies.
      Returns:
        the name of the sequence
      Default:
        ""

  - - #### loadFetchGroup

          public abstract 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 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 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 String column

      Column name where the values are stored for this member.
      Returns:
        the name of the column
      Default:
        ""

  - - #### nullIndicatorColumn

          public abstract 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 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 String cacheable

      Whether this field/property is cacheable in a Level2 cache.
      Returns:
        Whether the field is L2 cacheable
      Since:
        2.2
      Default:
        "true"

  - - #### converter

          public abstract Class<? extends AttributeConverter> converter

      Optional `AttributeConverter` to use for converting this member.
      Returns:
        Converter class for converting this member when not PersistenceCapable (or NullAttributeConverter when not specified).
      Default:
        javax.jdo.AttributeConverter.UseDefault.class

  - - #### useDefaultConversion

          public abstract boolean useDefaultConversion

      Whether we should disable any converter that was specified as default for this type on the PMF. Only has any effect when this is explicitly set to true, when any AttributeConverter specified for this type either here or for the class or at the PMF will be ignored and will use the JDO implementation default handling.
      Returns:
        Whether PMF attribute conversion is to be disabled.
      Default:
        false

  - - #### extensions

          public abstract Extension[] extensions

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

Copyright © 2005–1970 Apache Software Foundation. All rights reserved.