Return-Path: X-Original-To: apmail-db-jdo-commits-archive@www.apache.org Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB3DD10AA4 for ; Sun, 5 Jan 2014 10:05:04 +0000 (UTC) Received: (qmail 33224 invoked by uid 500); 5 Jan 2014 10:05:04 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 33214 invoked by uid 99); 5 Jan 2014 10:05:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jan 2014 10:05:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Jan 2014 10:04:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 23D0023888FE; Sun, 5 Jan 2014 10:04:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1555473 [2/2] - in /db/jdo/site/src/site: site.xml xdoc/annotations.xml Date: Sun, 05 Jan 2014 10:04:09 -0000 To: jdo-commits@db.apache.org From: andyj@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140105100410.23D0023888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: db/jdo/site/src/site/xdoc/annotations.xml URL: http://svn.apache.org/viewvc/db/jdo/site/src/site/xdoc/annotations.xml?rev=1555473&view=auto ============================================================================== --- db/jdo/site/src/site/xdoc/annotations.xml (added) +++ db/jdo/site/src/site/xdoc/annotations.xml Sun Jan 5 10:04:09 2014 @@ -0,0 +1,2719 @@ + + + + JDO Annotations + + + +
+

+ One of the things that JDK 1.5 provides that can be of some use is annotations, and JDO provides its + own set. When selecting to use annotations please bear in mind the following :- +

+
    +
  • You must have the jdo-api jar in your CLASSPATH since this provides the annotations
  • +
  • Annotations should really only be used for attributes of persistence that you won't be changing + at deployment. Things such as table and column names shouldn't really be specified using annotations + although it is permitted. Instead it would be better to put such information in an ORM MetaData file.
  • +
  • Annotations can be added in two places - for the class as a whole, or for a field in particular.
  • +
  • You can annotate fields or getters with field-level information. If you annotate fields then the + fields are processed for persistence. If you annotate the methods (getters) then the methods (properties) + are processed for persistence.
  • +
  • Annotations are prefixed by the @ symbol and can take properties (in brackets after the name, + comma-separated)
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AnnotationClass/Field/MethodDescription
@PersistenceCapableClassSpecifies that the class/interface is persistent. In the case of an interface this would + utilise JDO2's "persistent-interface" capabilities
@PersistenceAwareClassSpecifies that the class is not persistent but needs to be able to access fields of persistent classes
@CacheableClassSpecifies whether this class can be cached in a Level 2 cache or not.
@EmbeddedOnlyClassSpecifies that the class is persistent and can only be persisted embedded in another persistent class
@DatastoreIdentityClassSpecifies the details for generating datastore-identity for this class
@VersionClassSpecifies any versioning process for objects of this class
@FetchPlansClassDefines a series of fetch plans
@FetchPlanClassDefines a fetch plan
@FetchGroupsClassDefines a series of fetch groups for this class
@FetchGroupClassDefines a fetch group for this class
@SequenceClassDefines a sequence for use by this class
@QueriesClassDefines a series of named queries for this class
@QueryClassDefines a named query for this class
@InheritanceClassSpecifies the inheritance model for persisting this class
@DiscriminatorClassSpecifies any discriminator for this class to be used for determining object types
@PrimaryKeyClassORM : Defines the primary key constraint for this class
@IndicesClassORM : Defines a series of indices for this class
@IndexClassORM : Defines an index for the class as a whole (typically a composite index)
@UniquesClassORM : Defines a series of unique constraints for this class
@UniqueClassORM : Defines a unique constraint for the class as a whole (typically a composite)
@ForeignKeysClassORM : Defines a series of foreign-keys (typically for non-mapped columns/tables)
@ForeignKeyClassORM : Defines a foreign-key for the class as a whole (typically for non-mapped columns/tables)
@JoinsClassORM : Defines a series of joins to secondary tables from this table
@JoinClassORM : Defines a join to a secondary table from this table
@ColumnsClassORM : Defines a series of columns that dont have associated fields ("unmapped columns")
@PersistentField/MethodDefines the persistence for a field/property of the class
@SerializedField/MethodDefines this field as being stored serialised
@NotPersistentField/MethodDefines this field as being not persisted
@TransactionalField/MethodDefines this field as being transactional (not persisted, but managed)
@CacheableField/MethodSpecifies whether this field/property can be cached in a Level 2 cache or not.
@PrimaryKeyField/MethodDefines this field as being (part of) the primary key
@ElementField/MethodDefines the details of elements of an array/collection stored in this field
@KeyField/MethodDefines the details of keys of a map stored in this field
@ValueField/MethodDefines the details of values of a map stored in this field
@OrderField/MethodORM : Defines the details of ordering of an array/collection stored in this field
@JoinField/MethodORM : Defines the join to a join table for a collection/array/map
@EmbeddedField/MethodORM : Defines that this field is embedded and how it is embedded
@ColumnsField/MethodORM : Defines a series of columns where a field is persisted
@ColumnField/MethodORM : Defines a column where a field is persisted
@IndexField/MethodORM : Defines an index for the field
@UniqueField/MethodORM : Defines a unique constraint for the field
@ForeignKeyField/MethodORM : Defines a foreign key for the field
@ExtensionsClass/Field/MethodDefines a series of JDO extensions
@ExtensionClass/Field/MethodDefines a JDO extension
+
+ + + +

+ This annotation is used when you want to mark a class as persistent. + It equates to the <class> MetaData element (though with only some of its attributes). + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
requiresExtentStringWhether an extent is required for this classtrue
embeddedOnlyStringWhether objects of this class can only be stored embedded in other objectsfalse
detachableStringWhether objects of this class can be detachedfalse
identityTypeIdentityTypeType of identity (APPLICATION, DATASTORE, NONDURABLE)DATASTORE
objectIdClassClassObject-id class
tableStringORM : Name of the table where this class is persisted
catalogStringORM : Name of the catalog where this table is persisted
schemaStringORM : Name of the schema where this table is persisted
cacheableStringWhether the class can be L2 cached. From JDO2.2true | false
serializeReadStringWhether to default reads of this object type to lock the objectfalse
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable(identityType=IdentityType.APPLICATION) +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ This annotation is used when you want to mark a class as being used in persistence but not being persistable. + That is "persistence-aware" in JDO terminology. It has no attributes. + Specified on the class. +

+ +@PersistenceAware +public class MyClass +{ + ... +} +

See the documentation for Class Types

+
+
+ + + + +

+ This annotation is a shortcut for @PersistenceCapable(cacheable={value}) specifying whether + the class can be cached in a Level 2 cache. + Specified on the class. The default +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueStringWhether the class is cacheabletrue | false
+ +@Cacheable("false") +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ This annotation is a shortcut for @PersistenceCapable(embeddedOnly="true") meaning that the class can only + be persisted embedded into another class. It has no attributes. + Specified on the class. +

+ +@EmbeddedOnly +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define the inheritance for a class. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
strategyInheritanceStrategyThe inheritance strategy (NEW_TABLE, SUBCLASS_TABLE, SUPERCLASS_TABLE)
customStrategyStringName of a custom inheritance strategy (depending on + what your JDO implementation supports
+ +@PersistenceCapable +@Inheritance(strategy=InheritanceStrategy.NEW_TABLE) +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define a discriminator to be stored with instances of this class and is used + to determine the types of the objects being stored. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
strategyDiscriminatorStrategyThe discriminator strategy (VALUE_MAP, CLASS_NAME, NONE)
valueStringValue to use for instances of this type when using strategy of VALUE_MAP
columnStringORM : Name of the column to use to store the discriminator
indexedStringORM : Whether the discriminator column is to be indexed
columnsColumn[]ORM : Column definitions used for storing the discriminator
+ +@PersistenceCapable +@Inheritance(strategy=InheritanceStrategy.NEW_TABLE) +@Discriminator(strategy=DiscriminatorStrategy.CLASS_NAME) +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define the identity when using datastore-identity for the class. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
strategyIdGeneratorStrategyThe inheritance strategy (NATIVE, SEQUENCE, IDENTITY, INCREMENT, UUIDSTRING, UUIDHEX)
customStrategyStringName of a custom id generation strategy (e.g "max", "auid"). + This overrides the value of "strategy"
sequenceStringName of the sequence to use (when using SEQUENCE strategy) - refer to @Sequence
columnStringORM : Name of the column for the datastore identity
columnsColumn[]ORM : Column definition for the column(s) for the datastore identity
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable +@DatastoreIdentity(strategy=IdGeneratorStrategy.INCREMENT) +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define the versioning details for use with optimistic transactions. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
strategyVersionStrategyThe version strategy (NONE, STATE_IMAGE, DATE_TIME, VERSION_NUMBER)
indexedStringWhether the version column(s) is indexed
columnStringORM : Name of the column for the version
columnsColumn[]ORM : Column definition for the column(s) for the version
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable +@Version(strategy=VersionStrategy.VERSION_NUMBER) +public class MyClass +{ + ... +} +

See the documentation for transactions

+
+
+ + + + +

+ Annotation used to define the primary key constraint for a class. + Maps across to the <primary-key> MetaData element. Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringORM : Name of the primary key constraint
columnStringORM : Name of the column for this key
columnsColumn[]ORM : Column definition for the column(s) of this key
+ +@PersistenceCapable +@PrimaryKey(name="MYCLASS_PK") +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define a set of fetch plans. + Specified on the class. Used by named queries +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueFetchPlan[]Array of fetch plans - see @FetchPlan annotation
+ +@PersistenceCapable +@FetchPlans({@FetchPlan(name="plan_3", maxFetchDepth=3, fetchGroups={"group1", "group4"}), + @FetchPlan(name="plan_4", maxFetchDepth=2, fetchGroups={"group1", "group2"})}) +public class MyClass +{ + ... +} +

See the documentation for FetchGroups

+
+
+ + + + +

+ Annotation used to define a fetch plan + Is equivalent to the <fetch-plan> metadata element. + Specified on the class. Used by named queries +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringName of the FetchPlan
maxFetchDepthintMaximum fetch depth1
fetchSizeintSize hint for fetching query result sets0
fetchGroupsString[]Names of the fetch groups included in this FetchPlan.
+ +@PersistenceCapable +@FetchPlan(name="plan_3", maxFetchDepth=3, fetchGroups={"group1", "group4"}) +public class MyClass +{ + ... +} +

See the documentation for FetchGroups

+
+
+ + + + +

+ Annotation used to define a set of fetch groups for a class. + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueFetchGroup[]Array of fetch groups - see @FetchGroup annotation
+ +@PersistenceCapable +@FetchGroups({@FetchGroup(name="one_two", members={@Persistent(name="field1"), @Persistent(name="field2")}), + @FetchGroup(name="three", members={@Persistent(name="field3")})}) +public class MyClass +{ + @Persistent + String field1; + + @Persistent + String field2; + + @Persistent + String field3; + ... +} +

See the documentation for FetchGroups

+
+
+ + + + +

+ Annotation used to define a fetch group. + Is equivalent to the <fetch-group> metadata element. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringName of the fetch group
postLoadStringWhether to call jdoPostLoad after loading this fetch group
membersPersistent[]Definitions of the fields/properties to include in this fetch group
+ +@PersistenceCapable +@FetchGroup(name="one_two", members={@Persistent(name="field1"), @Persistent(name="field2")}) +public class MyClass +{ + @Persistent + String field1; + + @Persistent + String field2; + ... +} +

See the documentation for FetchGroups

+
+
+ + + + +

+ Annotation used to define a sequence generator. + Is equivalent to the <sequence> metadata element. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringName of the sequence
strategySequenceStrategyStrategy for the sequence (NONTRANSACTIONAL, CONTIGUOUS, NONCONTIGUOUS)
datastoreSequenceStringName of a datastore sequence that this maps to
factoryClassClassFactory class to use to generate the sequence
initialValueintInitial value of the sequence1
allocationSizeintAllocation size of the sequence50
extensionsExtension[]Vendor extensions
+
+
+
+ +
+ +

+ Annotation used to define a set of named queries for a class. + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueQuery[]Array of queries - see @Query annotation
+ +@PersistenceCapable +@Queries({@Query(name="PeopleCalledSmith", language="JDOQL", + value="SELECT FROM mydomain.Person WHERE surname == \"Smith\""), + @Query(name="PeopleCalledJones", language="JDOQL", + value="SELECT FROM mydomain.Person WHERE surname == \"Jones\"")}) +public class Person +{ + @Persistent + String surname; + + ... +} +
+
+
+ +
+ +

+ Annotation used to define a named query. + Is equivalent to the <query> metadata element. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringName of the query
valueStringThe query string itself
languageStringLanguage of the query (JDOQL, SQL, ...)JDOQL
unmodifiableStringWhether the query is not modifiable at runtime
uniqueStringWhether the query returns unique results (for SQL queries only)
resultClassClassResult class to use (for SQL queries only)
fetchPlanStringName of a named FetchPlan to use with this query
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable +@Query(name="PeopleCalledSmith", language="JDOQL", + value="SELECT FROM mydomain.Person WHERE surname == \"Smith\"") +public class Person +{ + @Persistent + String surname; + + ... +} +
+
+
+ +
+ +

+ Annotation used to define a set of indices for a class. + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueIndex[]Array of indices - see @Index annotation
+ +@PersistenceCapable +@Indices({@Index(name="MYINDEX_1", members={"field1","field2"}), @Index(name="MYINDEX_2", members={"field3"})}) +public class Person +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define an index for the class as a whole typically being a composite index across + multiple columns or fields/properties. + Is equivalent to the <index> metadata element when specified under class. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringORM : Name of the index
tableStringORM : Name of the table for the index
uniqueStringORM : Whether the index is unique
membersString[]ORM : Names of the fields/properties that make up this index
columnsColumn[]ORM : Columns that make up this index
+ +@PersistenceCapable +@Index(name="MY_COMPOSITE_IDX", members={"field1", "field2"}) +public class MyClass +{ + @Persistent + String field1; + + @Persistent + String field2; + + ... +} +
+
+
+ +
+ +

+ Annotation used to define a set of unique constraints for a class. + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueUnique[]Array of constraints - see @Unique annotation
+ +@PersistenceCapable +@Uniques({@Unique(name="MYCONST_1", members={"field1","field2"}), @Unique(name="MYCONST_2", members={"field3"})}) +public class Person +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define a unique constraints for the class as a whole typically being a composite constraint across + multiple columns or fields/properties. + Is equivalent to the <unique> metadata element when specified under class. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringORM : Name of the constraint
tableStringORM : Name of the table for the constraint
deferredStringORM : Whether the constraint is deferred
membersString[]ORM : Names of the fields/properties that make up this constraint
columnsColumn[]ORM : Columns that make up this constraint
+ +@PersistenceCapable +@Unique(name="MY_COMPOSITE_IDX", members={"field1", "field2"}) +public class MyClass +{ + @Persistent + String field1; + + @Persistent + String field2; + + ... +} +
+
+
+ +
+ +

+ Annotation used to define a set of foreign-key constraints for a class. + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueForeignKey[]Array of FK constraints - see @ForeignKey annotation
+
+
+
+ +
+ +

+ Annotation used to define a foreign-key constraint for the class. + Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
nameStringORM : Name of the constraint
tableStringORM : Name of the table that the FK is to
deferredStringORM : Whether the constraint is deferred
uniqueStringORM : Whether the constraint is unique
deleteActionForeignKeyActionORM : Action to apply to the FK to be used on deletingForeignKeyAction.RESTRICT
updateActionForeignKeyActionORM : Action to apply to the FK to be used on updatingForeignKeyAction.RESTRICT
membersString[]ORM : Names of the fields/properties that compose this FK.
columnsColumn[]ORM : Columns that compose this FK.
+
+
+
+ +
+ +

+ Annotation used to define a set of joins (to secondary tables) for a class. + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueJoin[]Array of joins - see @Join annotation
+ +@PersistenceCapable +@Joins({@Join(table="MY_OTHER_TABLE", column="MY_PK_COL"), + @Join(table="MY_SECOND_TABLE", column="MY_PK_COL")}) +public class MyClass +{ + @Persistent(table="MY_OTHER_TABLE") + String myField; + + @Persistent(table="MY_SECOND_TABLE") + String myField2; + ... +} +
+
+
+ +
+ +

+ Annotation used to specify a join for a secondary table. Specified on the class. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
tableStringORM : Table name used when joining the PK of a FCO class table to a secondary table.
columnStringORM : Name of the column used to join to the PK of the primary table (when only one column used)
outerStringORM : Whether to use an outer join when retrieving fields/properties stored in the secondary table
columnsColumn[]ORM : Name of the colums used to join to the PK of the primary table (when multiple columns used)
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable(name="MYTABLE") +@Join(table="MY_OTHER_TABLE", column="MY_PK_COL") +public class MyClass +{ + @Persistent(name="MY_OTHER_TABLE") + String myField; + ... +} +
+
+
+ +
+ +

+ Annotation used to define the columns which have no associated field in the class. + User should specify a minimum of @Column "name", "jdbcType", and "insertValue". + Specified on the class. +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueColumn[]Array of columns - see @Column annotation
+ +@PersistenceCapable +@Columns(@Column(name="MY_OTHER_COL", jdbcType="VARCHAR", insertValue="N/A") +public class MyClass +{ + ... +} +
+
+
+ +
+ +

+ Annotation used to define the fields/properties to be persisted. + Is equivalent to the <field> and <property> metadata elements. + Specified on the field/method. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
persistenceModifierPersistenceModifierWhether the field is persistent (PERSISTENT, TRANSACTIONAL, NONE)[depends on field type]
defaultFetchGroupStringWhether the field is part of the DFG
nullValueNullValueRequired behaviour when inserting a null value for this field (NONE, EXCEPTION, DEFAULT).NONE
embeddedStringWhether this field as a whole is embedded. Use @Embedded to specify details.
embeddedElementStringWhether the element stored in this collection/array field/property is embedded
embeddedKeyStringWhether the key stored in this map field/property is embedded
embeddedValueStringWhether the value stored in this map field/property is embedded
serializedStringWhether this field/property as a whole is serialised
serializedElementStringWhether the element stored in this collection/array field/property is serialised
serializedKeyStringWhether the key stored in this map field/property is serialised
serializedValueStringWhether the value stored in this map field/property is serialised
dependentStringWhether this field is dependent, deleting the related object when deleting this object
dependentElementStringWhether the element stored in this field/property is dependent
dependentKeyStringWhether the key stored in this field/property is dependent
dependentValueStringWhether the value stored in this field/property is dependent
primaryKeyStringWhether this field is (part of) the primary keyfalse
valueStrategyIdGeneratorStrategyStrategy to use when generating values for the field (NATIVE, SEQUENCE, IDENTITY, INCREMENT, UUIDSTRING, UUIDHEX)
customValueStrategyStringName of a custom id generation strategy (e.g "max", "auid"). + This overrides the value of "valueStrategy"
sequenceStringName of the sequence when using valueStrategy of SEQUENCE - refer to @Sequence
typesClass[]Type(s) of field (when using interfaces/reference types).
mappedByStringField in other class when the relation is bidirectional to signify the owner of the relation
tableStringORM : Name of the table where this field is persisted. + If this field is a collection/map/array then the table refers to a join table, + otherwise this refers to a secondary table.
nameStringName of the field when defining an embedded field.
columnsColumn[]ORM : Column definition(s) for the columns into which this field is persisted. This is + only typically used when specifying columns of a field of an embedded class.
cacheableStringWhether the field/property can be L2 cached. From JDO2.2true | false
extensionsExtension[]Vendor extensions
recursionDepthintRecursion depth for this field when fetching. + Only applicable when specified within @FetchGroup1
loadFetchGroupStringName of a fetch group to activate when a load of this field is initiated (due to it + being currently unloaded). Not used for getObjectById, queries, extents etc. + Better to use @FetchGroup and define your groups
+ +@PersistenceCapable +public class MyClass +{ + @Persistent(primaryKey="true") + String myField; + ... +} +

See the documentation for Field Types

+
+
+ + + + +

+ This annotation is a shortcut for @Persistent(serialized="true") meaning that the field is stored + serialized. It has no attributes. Specified on the field/method. +

+ +@PersistenceCapable +public class MyClass +{ + @Serialized + Object myField; + ... +} +
+
+
+ +
+ +

+ This annotation is a shortcut for @Persistent(persistenceModifier=PersistenceModifier.NONE) meaning that the + field/property is not persisted. It has no attributes. Specified on the field/method. +

+ +@PersistenceCapable +public class MyClass +{ + @NotPersistent + String myOtherField; + ... +} +

See the documentation for Field Types

+
+
+ + + + +

+ This annotation is a shortcut for @Persistent(persistenceModifier=PersistenceModifier.TRANSACTIONAL) meaning that the + field/property is not persisted yet managed. It has no attributes. Specified on the field/method. +

+ +@PersistenceCapable +public class MyClass +{ + @Transactional + String myOtherField; + ... +} +

See the documentation for Field Types

+
+
+ + + + +

+ This annotation is a shortcut for @Persistent(cacheable={value}) specifying whether + the field/property can be cached in a Level 2 cache. + Specified on the field/property. The default +

+ + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
valueStringWhether the field/property is cacheabletrue | false
+ +public class MyClass +{ + @Cacheable("false") + Collection elements; + ... +} +
+
+
+ +
+ +

+ This annotation is a shortcut for @Persistent(primaryKey="true") meaning that the field/property is + part of the primary key for the class. + No attributes are needed when specified like this. Specified on the field/method. +

+ +@PersistenceCapable +public class MyClass +{ + @PrimaryKey + String myOtherField; + ... +} +
+
+
+ +
+ +

+ Annotation used to define the element for any collection/array to be persisted. + Maps across to the <collection>, <array> and <element> MetaData elements. + Specified on the field/method. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
typesClass[]Type(s) of elementWhen using an array is not needed. When using a collection will be taken from the collection definition if using + generics, otherwise must be specified.
embeddedStringWhether the element is embedded into a join table
serializedStringWhether the element is serialised into the join table
dependentStringWhether the element objects are dependent when deleting the owner collection/array
mappedByStringField in the element class that represents this object (when the relation is bidirectional)
embeddedMappingEmbedded[]Definition of any embedding of the (persistable) element. Only 1 "Embedded" should be provided
tableStringORM : Name of the table for this element
columnStringORM : Name of the column for this element
foreignKeyStringORM : Name of any foreign-key constraint to add
generateForeignKeyStringORM : Whether to generate a FK constraint for the element (when not specifying the name)
deleteActionForeignKeyActionORM : Action to be applied to the foreign key for this element for action upon deletion
updateActionForeignKeyActionORM : Action to be applied to the foreign key for this element for action upon update
indexStringORM : Name of any index constraint to add
indexedStringORM : Whether this element column is indexed
uniqueStringORM : Whether this element column is unique
uniqueKeyStringORM : Name of any unique key constraint to add
columnsColumn[]ORM : Column definition for the column(s) of this element
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable +public class MyClass +{ + @Element(types=mydomain.MyElementClass.class, dependent="true") + Collection myField; + ... +} +
+
+
+ +
+ +

+ Annotation used to define the ordering of an order-based Collection/array to be persisted. + Maps across to the <order> MetaData element. + Specified on the field/method. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
mappedByStringORM : Field in the element class that represents the ordering of the collection/array
columnStringORM : Name of the column for this order
columnsColumn[]ORM : Column definition for the column(s) of this order
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable +public class MyClass +{ + @Element(types=mydomain.MyElementClass.class, dependent="true") + @Order(column="ORDER_IDX") + Collection myField; + ... +} +
+
+
+ +
+ +

+ Annotation used to define the key for any map to be persisted. + Maps across to the <map> and <key> MetaData elements. + Specified on the field/method. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeTypeDescriptionDefault
typesClass[]Type(s) of key.When using generics will be taken from the Map definition, otherwise must be specified
embeddedStringWhether the key is embedded into a join table
serializedStringWhether the key is serialised into the join table
dependentStringWhether the key objects are dependent when deleting the owner map
mappedByStringUsed to specify the field in the value class where the key is stored (optional).
embeddedMappingEmbedded[]Definition of any embedding of the (persistable) key. Only 1 "Embedded" should be provided
tableStringORM : Name of the table for this key
columnStringORM : Name of the column for this key
foreignKeyStringORM : Name of any foreign-key constraint to add
generateForeignKeyStringORM : Whether to generate a FK constraint for the key (when not specifying the name)
deleteActionForeignKeyActionORM : Action to be applied to the foreign key for this key for action upon deletion
updateActionForeignKeyActionORM : Action to be applied to the foreign key for this key for action upon update
indexStringORM : Name of any index constraint to add
indexedStringORM : Whether this key column is indexed
uniqueKeyStringORM : Name of any unique key constraint to add
uniqueStringORM : Whether this key column is unique
columnsColumn[]ORM : Column definition for the column(s) of this key
extensionsExtension[]Vendor extensions
+ +@PersistenceCapable +public class MyClass +{ + @Key(types=java.lang.String.class) + Map myField; + ... +} +
+
+
+ +
+ +

+ Annotation used to define the value for any map to be persisted. + Maps across to the <map> and <value> MetaData elements. + Specified on the field/method. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [... 580 lines stripped ...]
AttributeTypeDescriptionDefault
typesClass[]Type(s) of value.When using generics will be taken from the Map definition, otherwise must be specified
embeddedStringWhether the value is embedded into a join table
serializedStringWhether the value is serialised into the join table
dependentStringWhether the value objects are dependent when deleting the owner map
mappedByStringUsed to specify the field in the key class where the value is stored (optional).
embeddedMappingEmbedded[]Definition of any embedding of the (persistable) value. Only 1 "Embedded" should be provided
tableStringORM : Name of the table for this value
columnStringORM : Name of the column for this value
foreignKeyStringORM : Name of any foreign-key constraint to add
deleteActionForeignKeyActionORM : Action to be applied to the foreign key for this value for action upon deletion
generateForeignKeyStringORM : Whether to generate a FK constraint for the value (when not specifying the name)
updateActionForeignKeyAction