Index: test/java/javax/jdo/annotations/TestEmbeddedSet.java =================================================================== --- test/java/javax/jdo/annotations/TestEmbeddedSet.java (revision 557845) +++ test/java/javax/jdo/annotations/TestEmbeddedSet.java (working copy) @@ -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(); Index: test/java/javax/jdo/annotations/TestEmbeddedMap.java =================================================================== --- test/java/javax/jdo/annotations/TestEmbeddedMap.java (revision 557845) +++ test/java/javax/jdo/annotations/TestEmbeddedMap.java (working copy) @@ -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(); Index: src/java/javax/jdo/annotations/Join.java =================================================================== --- src/java/javax/jdo/annotations/Join.java (revision 557845) +++ src/java/javax/jdo/annotations/Join.java (working copy) @@ -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 ""; Index: src/java/javax/jdo/annotations/Persistent.java =================================================================== --- src/java/javax/jdo/annotations/Persistent.java (revision 557845) +++ src/java/javax/jdo/annotations/Persistent.java (working copy) @@ -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 + /** 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 fieldType() default void.class; + Class[] boundTypes() default {}; - /** 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 + /** Name of the related member in the other class + * where this value is mapped (bidirectional relationship). + * @return the related member in the other class */ - 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 - */ 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 {}; Index: src/java/javax/jdo/annotations/FetchGroup.java =================================================================== --- src/java/javax/jdo/annotations/FetchGroup.java (revision 557845) +++ src/java/javax/jdo/annotations/FetchGroup.java (working copy) @@ -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 {}; + +} Index: src/java/javax/jdo/annotations/Unique.java =================================================================== --- src/java/javax/jdo/annotations/Unique.java (revision 557845) +++ src/java/javax/jdo/annotations/Unique.java (working copy) @@ -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 + /** Columns that compose this unique constraint. + * @return columns that compose this unique constraint */ - String[] properties() default {}; - - /** Columns that comprise this unique constraint. - * @return columns that comprise this unique constraint - */ Column[] columns() default {}; } Index: src/java/javax/jdo/annotations/Field.java =================================================================== --- src/java/javax/jdo/annotations/Field.java (revision 557845) +++ src/java/javax/jdo/annotations/Field.java (working copy) @@ -1,158 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.jdo.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for defining the persistence of a field. - * - * @version 2.1 - * @since 2.1 - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Field -{ - /** Modifier for this field. - * @return the persistence modifier - */ - FieldPersistenceModifier persistenceModifier() - default FieldPersistenceModifier.UNKNOWN; - - /** Table to use for persisting this field. - * @return the table to use for persisting this field - */ - String table() default ""; - - /** Whether this field is in the default fetch group. - * @return whether this field 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 - */ - NullValue nullValue() default NullValue.NONE; - - /** Whether this field is embedded. - * @return whether this field is embedded - */ - String embedded() default ""; - - /** Whether the elements of this field are embedded. - * @return whether the elements of this field are embedded - */ - String embeddedElement() default ""; - - /** Whether the keys of this field are embedded. - * @return whether the keys of this field are embedded - */ - String embeddedKey() default ""; - - /** Whether the values of this field are embedded. - * @return whether the values of this field are embedded - */ - String embeddedValue() default ""; - - /** Whether this field is serialised into a single column. - * @return whether this field is serialized into a single column - */ - String serialized() default ""; - - /** Whether related object(s) of this field are dependent - * and so deleted when this object is deleted. - * @return whether the related object(s) of this field 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 - */ - String primaryKey() default ""; - - /** Value strategy to use to populate this field (if any). - * @return the generated value strategy - */ - IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNKNOWN; - - /** Name of the sequence to use with particular value strategies. - * @return the name of the sequence - */ - String sequence() default ""; - - /** Name of the fetch-group to use when this field 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 - */ - 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[] 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. - * @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. - * @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 - */ - String name() default ""; - - /** Vendor extensions for this field. - * @return the vendor extensions - */ - Extension[] extensions() default {}; -} Index: src/java/javax/jdo/annotations/Property.java =================================================================== --- src/java/javax/jdo/annotations/Property.java (revision 557845) +++ src/java/javax/jdo/annotations/Property.java (working copy) @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.jdo.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for defining the persistence of a property of a persistent interface. - * - * @version 2.1 - * @since 2.1 - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Property -{ - /** Modifier for this property. - * @return the persistence modifier - */ - FieldPersistenceModifier persistenceModifier() - default FieldPersistenceModifier.UNKNOWN; - - /** Table to use for persisting this property. - * @return the table to use for persisting this property - */ - String table() default ""; - - /** Whether this property is in the default fetch group. - * @return whether this property is in the default fetch group - */ - String defaultFetchGroup() default ""; - - /** Behavior when this property contains a null value. - * @return the behavior when this property contains a null value - */ - NullValue nullValue() default NullValue.NONE; - - /** Whether this property is embedded. - * @return whether this property is embedded - */ - String embedded() default ""; - - /** Whether the elements of this field are embedded. - * @return whether the elements of this field are embedded - */ - String embeddedElement() default ""; - - /** Whether the keys of this field are embedded. - * @return whether the keys of this field are embedded - */ - String embeddedKey() default ""; - - /** Whether the values of this field are embedded. - * @return whether the values of this field are embedded - */ - String embeddedValue() default ""; - - /** Whether this property is serialized into a single column. - * @return whether this property is serialized into a single column - */ - String serialized() default ""; - - /** Whether related object(s) of this property are dependent - * and so deleted when this object is deleted. - * @return whether the related object(s) of this property are dependent - */ - String dependent() default ""; - - /** Whether this property is part of the primary key of the class. - * @return whether this property is part of the primary key of the class - */ - String primaryKey() default ""; - - /** Value strategy to use to populate this property (if any). - * @return the generated value strategy - */ - IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNKNOWN; - - /** Name of the sequence to use with particular value strategies. - * @return the name of the sequence - */ - String sequence() default ""; - - /** Name of the fetch-group to use when this property is loaded - * due to being referenced when not already loaded - * @return the name of the load fetch group - */ - String loadFetchGroup() default ""; - - /** Type of the property. Used when the property is a reference type - * and we want to be specific. - * @return the property type - */ - Class fieldType() default void.class; - - /** Type of the property. This is used as an alternative to "fieldType" - * when the implementation supports specification of multiple property - * types. If "fieldType" is specified then this is ignored. - * @return the property types - */ - Class[] fieldTypes() default {}; - - /** Name of the related property in the other class where this value is - * mapped - * (bidirectional relationship). - * @return the related property in the other class - */ - String mappedBy() default ""; - - /** Column definition(s) for this property. Used for mapping multiple - * columns - * to the same property, for example relationships with multiple column - * foreign keys. - * @return the columns for this property - */ - Column[] columns() default {}; - - /** Column name for this property. Used for mapping embedded properties - * where both the property name and column name are specified in the same - * annotation. - * @return the name of the column - */ - String column() default ""; - - /** Null indicator column for this property. Used for nested embedded - * properties where the null indicator column is needed. - * @return the null indicator column - */ - String nullIndicatorColumn() default ""; - - /** Name of the property when this is embedded in another object. - * @return the name of the property - */ - String name() default ""; - - /** Vendor extensions for this property. - * @return the vendor extensions - */ - Extension[] extensions() default {}; -} Index: src/java/javax/jdo/annotations/Embedded.java =================================================================== --- src/java/javax/jdo/annotations/Embedded.java (revision 557845) +++ src/java/javax/jdo/annotations/Embedded.java (working copy) @@ -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 +} Index: src/java/javax/jdo/annotations/Serialized.java =================================================================== --- src/java/javax/jdo/annotations/Serialized.java (revision 557845) +++ src/java/javax/jdo/annotations/Serialized.java (working copy) @@ -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 Index: src/java/javax/jdo/annotations/ForeignKey.java =================================================================== --- src/java/javax/jdo/annotations/ForeignKey.java (revision 557845) +++ src/java/javax/jdo/annotations/ForeignKey.java (working copy) @@ -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 + /** Columns that compose this foreign key. + * @return the columns that compose this foreign key */ - String[] properties() default {}; - - /** Columns that comprise this foreign key. - * @return the columns that comprise this foreign key - */ Column[] columns() default {}; } Index: src/java/javax/jdo/annotations/Transactional.java =================================================================== --- src/java/javax/jdo/annotations/Transactional.java (revision 557845) +++ src/java/javax/jdo/annotations/Transactional.java (working copy) @@ -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 */ Index: src/java/javax/jdo/annotations/PersistenceModifier.java =================================================================== --- src/java/javax/jdo/annotations/PersistenceModifier.java (revision 557845) +++ src/java/javax/jdo/annotations/PersistenceModifier.java (working copy) @@ -22,7 +22,7 @@ * @version 2.1 * @since 2.1 */ -public enum FieldPersistenceModifier +public enum PersistenceModifier { UNKNOWN, PERSISTENT, Index: src/java/javax/jdo/annotations/Index.java =================================================================== --- src/java/javax/jdo/annotations/Index.java (revision 557845) +++ src/java/javax/jdo/annotations/Index.java (working copy) @@ -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 + /** Columns that compose this index. + * @return columns that compose this index */ - String[] properties() default {}; - - /** Columns that comprise this index. - */ Column[] columns() default {}; } Index: src/java/javax/jdo/annotations/FieldPersistenceModifier.java =================================================================== --- src/java/javax/jdo/annotations/FieldPersistenceModifier.java (revision 557845) +++ src/java/javax/jdo/annotations/FieldPersistenceModifier.java (working copy) @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.jdo.annotations; - -/** - * Enumeration of the JDO2 persistence-modifier values for a field. - * - * @version 2.1 - * @since 2.1 - */ -public enum FieldPersistenceModifier -{ - UNKNOWN, - PERSISTENT, - TRANSACTIONAL, - NONE -}; \ No newline at end of file Index: src/java/javax/jdo/annotations/Transient.java =================================================================== --- src/java/javax/jdo/annotations/Transient.java (revision 557845) +++ src/java/javax/jdo/annotations/Transient.java (working copy) @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.jdo.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for whether the field is transient (not persisted). - * This is the same as specifying - * "@Field(persistenceModifier=FieldPersistenceModifier.NONE)". - * - * @version 2.1 - * @since 2.1 - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface Transient -{ -} \ No newline at end of file Index: src/java/javax/jdo/annotations/Order.java =================================================================== --- src/java/javax/jdo/annotations/Order.java (revision 557845) +++ src/java/javax/jdo/annotations/Order.java (working copy) @@ -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 Index: src/java/javax/jdo/annotations/Value.java =================================================================== --- src/java/javax/jdo/annotations/Value.java (revision 557845) +++ src/java/javax/jdo/annotations/Value.java (working copy) @@ -115,8 +115,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 +132,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 ""; Index: src/java/javax/jdo/annotations/NotPersistent.java =================================================================== --- src/java/javax/jdo/annotations/NotPersistent.java (revision 557845) +++ src/java/javax/jdo/annotations/NotPersistent.java (working copy) @@ -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 { } \ No newline at end of file Index: src/java/javax/jdo/annotations/Key.java =================================================================== --- src/java/javax/jdo/annotations/Key.java (revision 557845) +++ src/java/javax/jdo/annotations/Key.java (working copy) @@ -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 @@ -116,8 +116,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 ""; Index: src/java/javax/jdo/annotations/Element.java =================================================================== --- src/java/javax/jdo/annotations/Element.java (revision 557845) +++ src/java/javax/jdo/annotations/Element.java (working copy) @@ -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 @@ -117,10 +117,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 ""; Index: src/java/javax/jdo/annotations/PrimaryKey.java =================================================================== --- src/java/javax/jdo/annotations/PrimaryKey.java (revision 557845) +++ src/java/javax/jdo/annotations/PrimaryKey.java (working copy) @@ -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 Index: src/java/javax/jdo/annotations/Column.java =================================================================== --- src/java/javax/jdo/annotations/Column.java (revision 557845) +++ src/java/javax/jdo/annotations/Column.java (working copy) @@ -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. Index: src/java/javax/jdo/annotations/FetchField.java =================================================================== --- src/java/javax/jdo/annotations/FetchField.java (revision 557845) +++ src/java/javax/jdo/annotations/FetchField.java (working copy) @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package javax.jdo.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotation for defining a field in a FetchGroup. - * - * @version 2.1 - * @since 2.1 - */ -@Target({ElementType.FIELD, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -public @interface FetchField -{ - /** Name of the field (required). - * @return the name of the field - */ - String name(); - - /** Recursion depth for this field. - * @return the recursion depth - */ - int recursionDepth() default 1; -} \ No newline at end of file