db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r553037 - in /db/jdo/trunk: api2/src/java/javax/jdo/annotations/ tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/ tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/
Date Wed, 04 Jul 2007 01:43:46 GMT
Author: clr
Date: Tue Jul  3 18:43:44 2007
New Revision: 553037

URL: http://svn.apache.org/viewvc?view=rev&rev=553037
Log:
JDO-403 Changes to solve table, catalog, schema, and embedded field issues.
 
1. Add element String name() to @Field instead of embeddedFieldName to name the field of the
embedded mapping. 
2. Allow dotted notation for field names for nested embedded. 
3. Add element String nullIndicatorColumn() to @Field to identify nested embedded null indicator.

4. Add element String column() to @Field 
5. Add element String table() to @Field 
6. Remove @PersistentInterface, @Table, @SecondaryTable, @JoinTable 
7. Add element String table() to @PersistenceCapable 
8. Add element String catalog() to @PersistenceCapable 
9. Add element String schema() to @PersistenceCapable 

D    api2/src/java/javax/jdo/annotations/SecondaryTable.java
D    api2/src/java/javax/jdo/annotations/JoinTable.java
D    api2/src/java/javax/jdo/annotations/PersistentInterface.java
M    api2/src/java/javax/jdo/annotations/Field.java
D    api2/src/java/javax/jdo/annotations/Table.java
M    api2/src/java/javax/jdo/annotations/PersistenceCapable.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java
M    tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java

Removed:
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/JoinTable.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistentInterface.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/SecondaryTable.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Table.java
Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java
    db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java

Modified: 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/Field.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Field.java Tue Jul  3 18:43:44 2007
@@ -37,6 +37,10 @@
     FieldPersistenceModifier persistenceModifier() 
         default FieldPersistenceModifier.UNKNOWN;
 
+    /** 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
      */
@@ -98,13 +102,26 @@
      */
     String mappedBy() default "";
 
-    /** Column definition(s) for this field. Used for embedded fields. 
+    /** Column definition(s) for this field. Used for mapping multiple columns
+     * to the same field, for example relationships with multiple column
+     * foreign keys. 
      */
     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.
+     */
+    String column() default "";
+
+    /** Null indicator column for this field. Used for nested embedded fields 
+     * where the null indicator column is needed.
+     */
+    String nullIndicatorColumn() default "";
+
     /** Name of the field when this is embedded in another object. 
      */
-    String embeddedFieldName() default ""; 
+    String name() default ""; 
 
     /** Vendor extensions for this field. 
      */

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=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java Tue Jul  3 18:43:44
2007
@@ -22,29 +22,48 @@
 import java.lang.annotation.Target;
 
 /**
- * Annotation for whether the class is persistence-capable.
+ * Annotation for whether the class or interface is persistence-capable.
  * 
  * @version 2.1
  * @since 2.1
  */
-@Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE) 
+@Retention(RetentionPolicy.RUNTIME)
 public @interface PersistenceCapable
 {
-    /** Whether we require the ability to have extents of this class. */
+    /** Table to use for persisting this class or interface. 
+     */
+    String table() default "";
+
+    /** Catalog to use for persisting this class or interface. 
+     */
+    String catalog() default "";
+
+    /** Schema to use for persisting this class or interface. 
+     */
+    String schema() default "";
+
+    /** Whether this class or interface manages an extent. 
+     */
     String requiresExtent() default "";
 
-    /** Whether objects of this class can only be embedded. */
+    /** Whether objects of this class or interface can only be embedded. 
+     */
     String embeddedOnly() default "";
 
-    /** Whether this class is detachable. */
+    /** Whether this class or interface is detachable. 
+     */
     String detachable() default "";
 
-    /** Type of identity for this class. */
-    IdentityType identityType() default IdentityType.DATASTORE;
+    /** Type of identity for this class or interface. 
+     */
+    IdentityType identityType() default IdentityType.UNKNOWN;
 
-    /** Primary key class when using application identity and using own PK. */
+    /** Primary key class when using application identity and using own PK. 
+     */
     Class objectIdClass() default void.class;
 
-    /** Any vendor extensions. */
+    /** Any vendor extensions. 
+     */
     Extension[] extensions() default {};
 }

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCCompany.java Tue
Jul  3 18:43:44 2007
@@ -58,12 +58,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     private FCAddress     address;
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/FCPerson.java Tue
Jul  3 18:43:44 2007
@@ -61,12 +61,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     private FCAddress address;
 

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PICompany.java Tue
Jul  3 18:43:44 2007
@@ -37,12 +37,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     PIAddress getAddress();
     @Field(primaryKey="true")

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedApp/PIPerson.java Tue
Jul  3 18:43:44 2007
@@ -47,12 +47,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     PIAddress getAddress();
     Date getBirthdate();

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCCompany.java Tue
Jul  3 18:43:44 2007
@@ -59,12 +59,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     private FCAddress     address;
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT,

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/FCPerson.java Tue
Jul  3 18:43:44 2007
@@ -62,12 +62,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     private FCAddress address;
 

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PICompany.java Tue
Jul  3 18:43:44 2007
@@ -37,12 +37,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     PIAddress getAddress();
     @Column(name="ID")

Modified: db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java?view=diff&rev=553037&r1=553036&r2=553037
==============================================================================
--- db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java (original)
+++ db/jdo/trunk/tck2/src/java/org/apache/jdo/tck/pc/companyAnnotatedDS/PIPerson.java Tue
Jul  3 18:43:44 2007
@@ -46,12 +46,12 @@
     @Field(persistenceModifier=FieldPersistenceModifier.PERSISTENT)
     @Embedded(nullIndicatorColumn="COUNTRY",
         fields={
-            @Field(embeddedFieldName="addrid", columns=@Column(name="ADDRID")),
-            @Field(embeddedFieldName="street", columns=@Column(name="STREET")),
-            @Field(embeddedFieldName="city", columns=@Column(name="CITY")),
-            @Field(embeddedFieldName="state", columns=@Column(name="STATE")),
-            @Field(embeddedFieldName="zipcode", columns=@Column(name="ZIPCODE")),
-            @Field(embeddedFieldName="country", columns=@Column(name="COUNTRY"))
+            @Field(name="addrid", columns=@Column(name="ADDRID")),
+            @Field(name="street", columns=@Column(name="STREET")),
+            @Field(name="city", columns=@Column(name="CITY")),
+            @Field(name="state", columns=@Column(name="STATE")),
+            @Field(name="zipcode", columns=@Column(name="ZIPCODE")),
+            @Field(name="country", columns=@Column(name="COUNTRY"))
     })
     PIAddress getAddress();
     Date getBirthdate();



Mime
View raw message