Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 29005 invoked from network); 25 Jul 2007 23:29:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 23:29:44 -0000 Received: (qmail 89944 invoked by uid 500); 25 Jul 2007 23:29:45 -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 89916 invoked by uid 99); 25 Jul 2007 23:29:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 16:29:45 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 16:29:42 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 27BE91A981A; Wed, 25 Jul 2007 16:29:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r559647 - in /db/jdo/trunk/api2: src/java/javax/jdo/annotations/ test/java/javax/jdo/annotations/ Date: Wed, 25 Jul 2007 23:29:21 -0000 To: jdo-commits@db.apache.org From: clr@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070725232922.27BE91A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: clr Date: Wed Jul 25 16:29:20 2007 New Revision: 559647 URL: http://svn.apache.org/viewvc?view=rev&rev=559647 Log: JDO-510 Renamed @Field to @Persistent; removed @Property Renamed FieldPersistenceModifier to PersistenceModifier Renamed @Transient to @NotPersistent Removed @FetchField Renamed @Persistent fields and properties to members Added: db/jdo/trunk/api2/src/java/javax/jdo/annotations/NotPersistent.java - copied, changed from r557845, db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transient.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java - copied, changed from r557845, db/jdo/trunk/api2/src/java/javax/jdo/annotations/FieldPersistenceModifier.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java - copied, changed from r557845, db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java Removed: db/jdo/trunk/api2/src/java/javax/jdo/annotations/FetchField.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/FieldPersistenceModifier.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Property.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transient.java Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Column.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Embedded.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/FetchGroup.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKey.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Index.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Order.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/PrimaryKey.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Serialized.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transactional.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Unique.java db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedMap.java db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedSet.java Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Column.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Column.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Column.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Column.java Wed Jul 25 16:29:20 2007 @@ -22,8 +22,8 @@ import java.lang.annotation.Target; /** - * Annotation for a column in the datastore. - * Maps across to the JDO2 element "column". + * Annotation for a column in the database. + * Maps to the xml element "column". * * @version 2.1 * @since 2.1 @@ -47,12 +47,12 @@ String target() default ""; /** - * Target field in the other class or interface for this column + * Target member in the other class or interface for this column * when part of a bidirectional relation. - * @return the target field for this column when part of + * @return the target member for this column when part of * a bidirectional relation. */ - String targetField() default ""; + String targetMember() default ""; /** * JDBC Type for this column. Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java Wed Jul 25 16:29:20 2007 @@ -24,7 +24,7 @@ /** * Annotation for the element of a collection/array relation. - * Maps across to the JDO2 element "element". + * Maps to the xml element "element". * * @version 2.1 * @since 2.1 @@ -34,19 +34,12 @@ public @interface Element { /** - * The type of the element. This can be determined for an array, - * or if using JDK1.5 generics but is required otherwise. - * @return The type of the element. - */ - Class type() default void.class; - - /** - * Types of the elements. This is used as an alternative to "type" when - * the implementation supports specification of multiple element types. - * If "type" is specified then this is ignored. + * Types of the elements. This can be determined if using JDK1.5 generics + * but is required otherwise. Multiple types can be specified if the + * implementation supports multiple types. * @return the types of elements */ - Class[] types() default {}; + Class[] boundTypes() default {}; /** * Whether the element is to be stored serialized (into a join table) @@ -117,10 +110,10 @@ String uniqueKey() default ""; /** - * Name of the field in the target class that forms a bidirectional - * relationship with this field. - * @return name of the field in the target class that forms a bidirectional - * relationship with this field + * Name of the member in the target class that forms a bidirectional + * relationship with this member. + * @return name of the member in the target class that forms a bidirectional + * relationship with this member */ String mappedBy() default ""; Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Embedded.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Embedded.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Embedded.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Embedded.java Wed Jul 25 16:29:20 2007 @@ -24,7 +24,7 @@ /** * Annotation to define that the object is embedded into the table of the * owning object. - * Maps across to the JDO2 element "embedded". + * Maps to the xml element "embedded". * * @version 2.1 * @since 2.1 @@ -33,11 +33,11 @@ @Retention(RetentionPolicy.RUNTIME) public @interface Embedded { - /** The field in the embedded object that links back to the owning object + /** The member in the embedded object that links back to the owning object * where it has a bidirectional relationship. - * @return the field that refers to the owner + * @return the member that refers to the owner */ - String ownerField() default ""; + String ownerMember() default ""; /** The column in the embedded object used to judge if the embedded object * is null. @@ -50,13 +50,9 @@ */ String nullIndicatorValue() default ""; - /** Field definitions for this embedding. - * @return the fields embedded in the field or property being annotated + /** Members for this embedding. + * @return the members embedded in the field or property being annotated */ - Field[] fields() default {}; + Persistent[] members() default {}; - /** Property definitions for this embedding. - * @return the properties embedded in the field or property being annotated - */ - Property[] properties() default {}; -} \ No newline at end of file +} Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/FetchGroup.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/FetchGroup.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/FetchGroup.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/FetchGroup.java Wed Jul 25 16:29:20 2007 @@ -23,7 +23,7 @@ /** * Annotation for the fetch group of a class. - * Maps across to the JDO2 element "fetch-group". + * Maps to the xml element "fetch-group". * * @version 2.1 * @since 2.1 @@ -46,12 +46,15 @@ String postLoad() default ""; /** - * Field definition for the fetch group. - * @return field definition for the fetch group + * Members (fields and properties) of the fetch group. The members + * should contain only name and recursionDepth. + * @return members for the fetch group */ - FetchField[] fields(); + Persistent[] members(); - // Annotations are badly designed in that they don't allow nested groups - // and object to "cycle detection" - // so we can't have nested fetch groups in annotations -} \ No newline at end of file + /** + * Fetch groups to be nested (included) in this fetch group. + */ + String[] fetchGroups() default {}; + +} Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKey.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKey.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKey.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKey.java Wed Jul 25 16:29:20 2007 @@ -22,8 +22,8 @@ import java.lang.annotation.Target; /** - * Annotation for a JDO foreign-key. - * Maps across to the JDO2 element "foreign-key". + * Annotation for a database foreign-key. + * Maps to the xml element "foreign-key". * * @version 2.1 * @since 2.1 @@ -64,18 +64,13 @@ */ ForeignKeyAction updateAction() default ForeignKeyAction.RESTRICT; - /** Field names that comprise this foreign key. - * @return the field names that comprise this foreign key + /** Member (field and property) names that compose this foreign key. + * @return the member names that compose this foreign key */ - String[] fields() default {}; + String[] members() default {}; - /** Property names that compose this foreign key. - * @return the property names that compose this foreign key - */ - String[] properties() default {}; - - /** Columns that comprise this foreign key. - * @return the columns that comprise this foreign key + /** Columns that compose this foreign key. + * @return the columns that compose this foreign key */ Column[] columns() default {}; } Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Index.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Index.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Index.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Index.java Wed Jul 25 16:29:20 2007 @@ -22,8 +22,9 @@ import java.lang.annotation.Target; /** - * Annotation for a JDO index. - * Maps across to the JDO2 element "index". + * Annotation for a database index. Used for database schema + * generation to create indexes. + * Maps to the xml element "index". * * @version 2.1 * @since 2.1 @@ -48,17 +49,13 @@ */ String unique() default ""; - /** Field names that compose this index. - * @return field names that compose this index + /** Member (field and property) names that compose this index. + * @return member names that compose this index */ - String[] fields() default {}; + String[] members() default {}; - /** Property names that compose this index. - * @return property names that compose this index - */ - String[] properties() default {}; - - /** Columns that comprise this index. + /** Columns that compose this index. + * @return columns that compose this index */ Column[] columns() default {}; } Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java Wed Jul 25 16:29:20 2007 @@ -23,7 +23,7 @@ /** * Annotation for the join of a relation. - * Maps across to the JDO2 element "join". + * Maps to the xml element "join". * * @version 2.1 * @since 2.1 @@ -52,7 +52,7 @@ */ String index() default ""; - /** Whether the join column is unique + /** Whether the join column is unique. * @return whether the join column(s) is(are) is unique */ String unique() default ""; Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java Wed Jul 25 16:29:20 2007 @@ -24,7 +24,7 @@ /** * Annotation for the key of a map relation. - * Maps across to the JDO2 element "key". + * Maps to the xml element "key". * * @version 2.1 * @since 2.1 @@ -34,19 +34,12 @@ public @interface Key { /** - * The type of the key. This can be determined if using JDK1.5 generics - * but is required otherwise. - * @return the type of the key - */ - Class type() default void.class; - - /** - * Types of the keys. This is used as an alternative to "type" when the - * implementation supports specification of multiple key types. - * If "type" is specified then this is ignored. + * Types of the keys. This can be determined if using JDK1.5 generics + * but is required otherwise. Multiple types can be specified if the + * implementation supports multiple types. * @return the types of keys */ - Class[] types() default {}; + Class[] boundTypes() default {}; /** * Whether the key is to be stored serialized (into a single column of a @@ -116,8 +109,8 @@ String uniqueKey() default ""; /** - * Name of a field in the value class where this key value is stored. - * @return the name of a field in the value where this key is stored + * Name of a member in the value class where this key is stored. + * @return the name of a member in the value class where this key is stored */ String mappedBy() default ""; Copied: db/jdo/trunk/api2/src/java/javax/jdo/annotations/NotPersistent.java (from r557845, db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transient.java) URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/NotPersistent.java?view=diff&rev=559647&p1=db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transient.java&r1=557845&p2=db/jdo/trunk/api2/src/java/javax/jdo/annotations/NotPersistent.java&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transient.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/NotPersistent.java Wed Jul 25 16:29:20 2007 @@ -22,15 +22,13 @@ import java.lang.annotation.Target; /** - * Annotation for whether the field is transient (not persisted). - * This is the same as specifying - * "@Field(persistenceModifier=FieldPersistenceModifier.NONE)". - * + * Annotation for whether the member is not persistent. + * This maps to xml attribute persistence-modifier="none". * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) -public @interface Transient +public @interface NotPersistent { } Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Order.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Order.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Order.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Order.java Wed Jul 25 16:29:20 2007 @@ -22,8 +22,8 @@ import java.lang.annotation.Target; /** - * Annotation for the order of a container field. - * Maps across to the JDO2 element "order". + * Annotation for the order of a container member. + * Maps to the xml element "order". * * @version 2.1 * @since 2.1 Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java Wed Jul 25 16:29:20 2007 @@ -31,6 +31,13 @@ @Retention(RetentionPolicy.RUNTIME) public @interface PersistenceCapable { + /** Member declarations. Annotations for persistent members of this + * class or interface can be specifed either here or on each member. + * Annotations for inherited members can only be specified here. + * @return member declarations + */ + Persistent[] members() default {}; + /** Table to use for persisting this class or interface. */ String table() default ""; Copied: db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java (from r557845, db/jdo/trunk/api2/src/java/javax/jdo/annotations/FieldPersistenceModifier.java) URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java?view=diff&rev=559647&p1=db/jdo/trunk/api2/src/java/javax/jdo/annotations/FieldPersistenceModifier.java&r1=557845&p2=db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/FieldPersistenceModifier.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java Wed Jul 25 16:29:20 2007 @@ -22,7 +22,7 @@ * @version 2.1 * @since 2.1 */ -public enum FieldPersistenceModifier +public enum PersistenceModifier { UNKNOWN, PERSISTENT, Copied: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java (from r557845, db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java) URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java?view=diff&rev=559647&p1=db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java&r1=557845&p2=db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java Wed Jul 25 16:29:20 2007 @@ -22,73 +22,114 @@ import java.lang.annotation.Target; /** - * Annotation for defining the persistence of a field. + * Annotation for defining the persistence of a member (field or property). * * @version 2.1 * @since 2.1 */ @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) -public @interface Field +public @interface Persistent { - /** Modifier for this field. + /** 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. * @return the persistence modifier */ - FieldPersistenceModifier persistenceModifier() - default FieldPersistenceModifier.UNKNOWN; + PersistenceModifier persistenceModifier() + default PersistenceModifier.UNKNOWN; - /** Table to use for persisting this field. - * @return the table to use for persisting this field + /** Table to use for persisting this member. + * @return the table to use for persisting this member */ String table() default ""; - /** Whether this field is in the default fetch group. - * @return whether this field is in the default fetch group + /** Whether this member is in the default fetch group. + * @return whether this member is in the default fetch group */ String defaultFetchGroup() default ""; - /** Behavior when this field contains a null value. - * @return the behavior when this field contains a null value + /** Behavior when this member contains a null value. + * @return the behavior when this member contains a null value */ NullValue nullValue() default NullValue.NONE; - /** Whether this field is embedded. - * @return whether this field is embedded + /** Whether this member is embedded. + * @return whether this member is embedded */ String embedded() default ""; - /** Whether the elements of this field are embedded. - * @return whether the elements of this field are embedded + /** Whether the elements of this member are embedded. + * @return whether the elements of this member are embedded */ String embeddedElement() default ""; - /** Whether the keys of this field are embedded. - * @return whether the keys of this field are embedded + /** Whether the keys of this member are embedded. + * @return whether the keys of this member are embedded */ String embeddedKey() default ""; - /** Whether the values of this field are embedded. - * @return whether the values of this field are embedded + /** Whether the values of this member are embedded. + * @return whether the values of this member are embedded */ String embeddedValue() default ""; - /** Whether this field is serialised into a single column. - * @return whether this field is serialized into a single column + /** Whether this member is serialized into a single column. + * @return whether this member is serialized into a single column */ String serialized() default ""; - /** Whether related object(s) of this field are dependent + /** Whether the elements of this member are serialized. + * @return whether the elements of this member are serialized + */ + String serializedElement() default ""; + + /** Whether the keys of this member are serialized. + * @return whether the keys of this member are serialized + */ + String serializedKey() default ""; + + /** Whether the values of this member are serialized. + * @return whether the values of this member are serialized + */ + String serializedValue() default ""; + + /** Whether related object(s) of this member are dependent * and so deleted when this object is deleted. - * @return whether the related object(s) of this field are dependent + * @return whether the related object(s) of this member + * are dependent */ String dependent() default ""; - /** Whether this field is part of the primary key of the class. - * @return whether this field is part of the primary key of the class + /** Whether the elements of this member are dependent. + * @return whether the elements of this member are dependent + */ + String dependentElement() default ""; + + /** Whether the keys of this member are dependent. + * @return whether the keys of this member are dependent + */ + String dependentKey() default ""; + + /** Whether the values of this member are dependent. + * @return whether the values of this member are dependent + */ + String dependentValue() default ""; + + /** 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. + * @return whether this member is part of the primary key */ String primaryKey() default ""; - /** Value strategy to use to populate this field (if any). + /** Value strategy to use to generate the value for this field + * or property (if any). * @return the generated value strategy */ IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNKNOWN; @@ -98,60 +139,63 @@ */ String sequence() default ""; - /** Name of the fetch-group to use when this field is loaded + /** Name of the fetch-group to use when this member is loaded * due to being referenced when not already loaded. * @return the name of the load fetch group */ String loadFetchGroup() default ""; - /** Type of the field. Used when the field is a reference type - * and we want to be specific. - * @return the field type - */ - Class fieldType() default void.class; - - /** Type of the field. This is used as an alternative to "fieldType" - * when the implementation supports specification of multiple field types. - * If "fieldType" is specified then this is ignored. - * @return the field types - */ - Class[] fieldTypes() default {}; - - /** Name of the related field in the other class where this value is mapped - * (bidirectional relationship). - * @return the related field in the other class + /** Bound 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. + * @return the bound types + */ + Class[] boundTypes() default {}; + + /** Name of the related member in the other class + * where this value is mapped (bidirectional relationship). + * @return the related member in the other class */ String mappedBy() default ""; - /** Column definition(s) for this field. Used for mapping multiple columns - * to the same field, for example relationships with multiple column - * foreign keys. - * @return the columns for this field + /** Column definition(s) for this member. Used for mapping + * multiple columns + * to the same member, for example relationships with + * multiple column foreign keys. + * @return the columns for this member */ Column[] columns() default {}; - /** Column name for this field. Used for mapping embedded fields where - * both the field name and column name are specified in the same - * annotation. + /** Column name where the values are stored for this member. * @return the name of the column */ String column() default ""; - /** Null indicator column for this field. Used for nested embedded fields - * where the null indicator column is needed. + /** Null indicator column for this member. Used for nested + * embedded fields or properties to indicate whether the embedded + * instance should have a null value. * @return the null indicator column */ String nullIndicatorColumn() default ""; - /** Name of the field when this is embedded in another object. - * The fully-qualified field name is used. For example, - * "line.point.x" refers to the field x in class Point that is embedded - * in class Line that is embedded in a field called line. - * @return the name of the field + /** 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. + * @return the name of the member */ String name() default ""; - /** Vendor extensions for this field. + /** Recursion depth for this member. Used only when + * the annotation is used within the definition of a FetchGroup. + * @return the recursion depth + */ + int recursionDepth() default 1; + + /** Vendor extensions for this member. * @return the vendor extensions */ Extension[] extensions() default {}; Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/PrimaryKey.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/PrimaryKey.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/PrimaryKey.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/PrimaryKey.java Wed Jul 25 16:29:20 2007 @@ -22,9 +22,10 @@ import java.lang.annotation.Target; /** - * Annotation for the primary key of a class. - * Maps across to the JDO2 element "primary-key". - * Also used to define a field as being (part of) the primary key. + * Annotation on a member to define it as a primary key member of a class or + * persistent interface using application identity. + * Also used to define the primary key columns of a secondary table. + * Maps to the xml element "primary-key". * * @version 2.1 * @since 2.1 Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Serialized.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Serialized.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Serialized.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Serialized.java Wed Jul 25 16:29:20 2007 @@ -22,8 +22,9 @@ import java.lang.annotation.Target; /** - * Annotation for whether the field is stored serialized. - * This is the same as specifying @Field(serialized="true"). + * Annotation on a member (field or property) to indicate that + * the member is stored serialized. + * This is the same as specifying @Persistent(serialized="true"). * * @version 2.1 * @since 2.1 Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transactional.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transactional.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transactional.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Transactional.java Wed Jul 25 16:29:20 2007 @@ -22,10 +22,9 @@ import java.lang.annotation.Target; /** - * Annotation for whether the field is transactional. - * This is the same as specifying - * "@Field(persistenceModifier=FieldPersistenceModifier.TRANSACTIONAL)". - * + * Annotation to indicate that a member (field or property) + * is transactional but not persistent. + * This maps to xml attribute persistence-modifier="transactional". * @version 2.1 * @since 2.1 */ Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Unique.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Unique.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Unique.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Unique.java Wed Jul 25 16:29:20 2007 @@ -22,7 +22,9 @@ import java.lang.annotation.Target; /** - * Annotation for a JDO unique constraint. + * Annotation for a database unique constraint. Used for database schema + * generation to create unique constraints. Also used to reorder database + * operations when flushing changes to avoid unique constraint violations. * Maps across to the JDO2 element "unique". * * @version 2.1 @@ -49,18 +51,13 @@ */ String deferred() default ""; - /** Field names that comprise this unique constraint. - * @return field names that comprise this unique constraint + /** Member (field and property) names that compose this unique constraint. + * @return member names that compose this unique constraint */ - String[] fields() default {}; + String[] members() default {}; - /** Property names that compose this unique constraint. - * @return the property names that compose this unique constraint - */ - String[] properties() default {}; - - /** Columns that comprise this unique constraint. - * @return columns that comprise this unique constraint + /** Columns that compose this unique constraint. + * @return columns that compose this unique constraint */ Column[] columns() default {}; } Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java (original) +++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java Wed Jul 25 16:29:20 2007 @@ -33,19 +33,12 @@ public @interface Value { /** - * The type of the value. This can be determined if using JDK1.5 generics - * but is required otherwise. - * @return The type of the value. - */ - Class type() default void.class; - - /** - * Types of the values. This is used as an alternative to "type" when the - * implementation supports specification of multiple value types. - * If "type" is specified then this is ignored. + * Types of the values. This can be determined if using JDK1.5 generics + * but is required otherwise. Multiple types can be specified if the + * implementation supports multiple types. * @return the types of values */ - Class[] types() default {}; + Class[] boundTypes() default {}; /** * Whether the value is to be stored serialized (into a single column of a @@ -115,8 +108,8 @@ String uniqueKey() default ""; /** - * Name of a field in the key class where this value is stored. - * @return the name of a field in the key class where this value is stored + * Name of a member in the key class where this value is stored. + * @return the name of a member in the key class where this value is stored */ String mappedBy() default ""; @@ -132,8 +125,8 @@ */ String generateForeignKey() default ""; - /** Name for a generated primary key constraint. - * @return the name of the generated primary key constraint + /** Name for a generated foreign key constraint. + * @return the name of the generated foreign key constraint */ String foreignKey() default ""; Modified: db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedMap.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedMap.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedMap.java (original) +++ db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedMap.java Wed Jul 25 16:29:20 2007 @@ -31,29 +31,29 @@ public TestEmbeddedMap() { } - @Field(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true") + @Persistent(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true") @Join(column="OWNER_FK") @Key(column="INTEGER") @Value( embedded=@Embedded( - fields={ - @Field(name="point1.x", column="POINT1_X"), - @Field(name="point1.y", column="POINT2_Y"), - @Field(name="point2.x", column="POINT2_X"), - @Field(name="point2.y", column="POINT2_Y") + members={ + @Persistent(name="point1.x", column="POINT1_X"), + @Persistent(name="point1.y", column="POINT2_Y"), + @Persistent(name="point2.x", column="POINT2_X"), + @Persistent(name="point2.y", column="POINT2_Y") })) Map integerLines; - @Property(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true") + @Persistent(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true") @Join(column="OWNER_FK") @Key(column="INTEGER") @Value( embedded=@Embedded( - properties={ - @Property(name="point1.x", column="POINT1_X"), - @Property(name="point1.y", column="POINT2_Y"), - @Property(name="point2.x", column="POINT2_X"), - @Property(name="point2.y", column="POINT2_Y") + members={ + @Persistent(name="point1.x", column="POINT1_X"), + @Persistent(name="point1.y", column="POINT2_Y"), + @Persistent(name="point2.x", column="POINT2_X"), + @Persistent(name="point2.y", column="POINT2_Y") })) abstract Map getIntegerLines(); Modified: db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedSet.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedSet.java?view=diff&rev=559647&r1=559646&r2=559647 ============================================================================== --- db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedSet.java (original) +++ db/jdo/trunk/api2/test/java/javax/jdo/annotations/TestEmbeddedSet.java Wed Jul 25 16:29:20 2007 @@ -33,27 +33,27 @@ public TestEmbeddedSet() { } - @Field (table="LINES", embeddedElement="true") + @Persistent (table="LINES", embeddedElement="true") @Join(column="OWNER_FK") @Element ( embedded=@Embedded( - fields={ - @Field(name="point1.x", column="POINT1_X"), - @Field(name="point1.y", column="POINT2_Y"), - @Field(name="point2.x", column="POINT2_X"), - @Field(name="point2.y", column="POINT2_Y") + members={ + @Persistent(name="point1.x", column="POINT1_X"), + @Persistent(name="point1.y", column="POINT2_Y"), + @Persistent(name="point2.x", column="POINT2_X"), + @Persistent(name="point2.y", column="POINT2_Y") })) Set lines; - @Property (embeddedElement="true") + @Persistent (embeddedElement="true") @Join(column="OWNER_FK") @Element ( embedded=@Embedded( - properties={ - @Property(name="point1.x", column="POINT1_X"), - @Property(name="point1.y", column="POINT2_Y"), - @Property(name="point2.x", column="POINT2_X"), - @Property(name="point2.y", column="POINT2_Y") + members={ + @Persistent(name="point1.x", column="POINT1_X"), + @Persistent(name="point1.y", column="POINT2_Y"), + @Persistent(name="point2.x", column="POINT2_X"), + @Persistent(name="point2.y", column="POINT2_Y") })) abstract Set getLines();