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
  • Element Details

    • 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:
      UNSPECIFIED
    • table

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

      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:
      NONE
    • embedded

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

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

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

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

      String serialized
      Whether this member is serialized into a single column.
      Returns:
      whether this member is serialized into a single column
      Default:
      ""
    • serializedElement

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

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

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

      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

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

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

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

      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:
      UNSPECIFIED
    • customValueStrategy

      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

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

      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

      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

      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

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

      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

      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

      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:
      {}