db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r566201 - /db/jdo/trunk/api2/src/java/javax/jdo/annotations/
Date Wed, 15 Aug 2007 14:45:57 GMT
Author: clr
Date: Wed Aug 15 07:45:55 2007
New Revision: 566201

URL: http://svn.apache.org/viewvc?view=rev&rev=566201
Log:
JOD-515 Change default annotations to UNSPECIFIED from UNKNOWN
Add custom strategy where enums are used
Fix typo in foreign key annotations

M    api2/src/java/javax/jdo/annotations/Join.java
M    api2/src/java/javax/jdo/annotations/ForeignKeyAction.java
M    api2/src/java/javax/jdo/annotations/Persistent.java
M    api2/src/java/javax/jdo/annotations/VersionStrategy.java
M    api2/src/java/javax/jdo/annotations/Version.java
M    api2/src/java/javax/jdo/annotations/IdGeneratorStrategy.java
M    api2/src/java/javax/jdo/annotations/DiscriminatorStrategy.java
M    api2/src/java/javax/jdo/annotations/PersistenceCapable.java
M    api2/src/java/javax/jdo/annotations/DatastoreIdentity.java
M    api2/src/java/javax/jdo/annotations/PersistenceModifier.java
M    api2/src/java/javax/jdo/annotations/Discriminator.java
M    api2/src/java/javax/jdo/annotations/Value.java
M    api2/src/java/javax/jdo/annotations/InheritanceStrategy.java
M    api2/src/java/javax/jdo/annotations/Key.java
M    api2/src/java/javax/jdo/annotations/Inheritance.java
M    api2/src/java/javax/jdo/annotations/Element.java
M    api2/src/java/javax/jdo/annotations/IdentityType.java

Modified:
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/DatastoreIdentity.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Discriminator.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/DiscriminatorStrategy.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKeyAction.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdGeneratorStrategy.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdentityType.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Inheritance.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/InheritanceStrategy.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/PersistenceCapable.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/Version.java
    db/jdo/trunk/api2/src/java/javax/jdo/annotations/VersionStrategy.java

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/DatastoreIdentity.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/DatastoreIdentity.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/DatastoreIdentity.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/DatastoreIdentity.java Wed Aug 15 07:45:55
2007
@@ -36,7 +36,13 @@
      * Strategy to use when generating datastore identities
      * @return Strategy to use when generating datastore identities
      */
-    IdGeneratorStrategy strategy() default IdGeneratorStrategy.UNKNOWN;
+    IdGeneratorStrategy strategy() default IdGeneratorStrategy.UNSPECIFIED;
+
+    /** Custom strategy to use to generate the value for the identity. 
+     * If customStrategy is non-empty, then strategy must be UNSPECIFIED.
+     * @return the custom strategy
+     */
+    String customStrategy() default "";
 
     /**
      * Name of sequence to use when the strategy involves sequences

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Discriminator.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Discriminator.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Discriminator.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Discriminator.java Wed Aug 15 07:45:55
2007
@@ -38,7 +38,13 @@
      * @return the strategy to use for the discriminator
      */
     DiscriminatorStrategy strategy() 
-        default DiscriminatorStrategy.UNKNOWN;
+        default DiscriminatorStrategy.UNSPECIFIED;
+
+    /** Custom strategy to use for the discriminator. 
+     * If customStrategy is non-empty, then strategy must be UNSPECIFIED.
+     * @return the custom strategy
+     */
+    String customStrategy() default "";
 
     /**
      * Whether the discriminator is indexed.

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/DiscriminatorStrategy.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/DiscriminatorStrategy.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/DiscriminatorStrategy.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/DiscriminatorStrategy.java Wed Aug 15
07:45:55 2007
@@ -24,7 +24,7 @@
  */
 public enum DiscriminatorStrategy
 {
-    UNKNOWN,
+    UNSPECIFIED,
     NONE,
     VALUE_MAP,
     CLASS_NAME

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=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Element.java Wed Aug 15 07:45:55 2007
@@ -83,13 +83,13 @@
      * Delete action to apply to any foreign key for the element.
      * @return delete action to apply to any foreign key for the element
      */
-    ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED;
 
     /**
      * Update action to apply to any foreign key for the element
      * @return update action to apply to any foreign key for the element
      */
-    ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED;
 
     /**
      * Whether the value column(s) should be indexed.

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKeyAction.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKeyAction.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKeyAction.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/ForeignKeyAction.java Wed Aug 15 07:45:55
2007
@@ -24,7 +24,7 @@
  */
 public enum ForeignKeyAction
 {
-    UNKNOWN,
+    UNSPECIFIED,
     RESTRICT,
     CASCADE,
     NULL,

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdGeneratorStrategy.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdGeneratorStrategy.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdGeneratorStrategy.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdGeneratorStrategy.java Wed Aug 15 07:45:55
2007
@@ -24,11 +24,11 @@
  */
 public enum IdGeneratorStrategy
 {
-    UNKNOWN,
+    UNSPECIFIED,
     NATIVE,
     SEQUENCE,
     IDENTITY,
     INCREMENT,
     UUIDSTRING,
     UUIDHEX
-};
\ No newline at end of file
+}
\ No newline at end of file

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdentityType.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdentityType.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdentityType.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/IdentityType.java Wed Aug 15 07:45:55
2007
@@ -24,7 +24,7 @@
  */
 public enum IdentityType
 {
-    UNKNOWN,
+    UNSPECIFIED,
     APPLICATION,
     DATASTORE,
     NONDURABLE

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Inheritance.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Inheritance.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Inheritance.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Inheritance.java Wed Aug 15 07:45:55
2007
@@ -37,5 +37,11 @@
      * the members for the class are stored. 
      * @return the inheritance strategy
      */
-    InheritanceStrategy strategy();
+    InheritanceStrategy strategy() default InheritanceStrategy.UNSPECIFIED;
+
+    /** Custom inheritance strategy. If customStrategy is non-empty, then
+     * strategy must be UNSPECIFIED.
+     * @return the custom inheritance strategy
+     */
+    String customStrategy() default "";
 }

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/InheritanceStrategy.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/InheritanceStrategy.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/InheritanceStrategy.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/InheritanceStrategy.java Wed Aug 15 07:45:55
2007
@@ -24,6 +24,7 @@
  */
 public enum InheritanceStrategy
 {
+    UNSPECIFIED,
     NEW_TABLE,
     SUBCLASS_TABLE,
     SUPERCLASS_TABLE

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=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Join.java Wed Aug 15 07:45:55 2007
@@ -71,7 +71,7 @@
     /** Delete action to be applied to any ForeignKey on this join.
      * @return the delete action
      */
-    ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED;
 
     /** Detail definition of the join column(s). This is needed for
      * more than one join column.
@@ -92,12 +92,12 @@
 
     /** Generate or assume a foreign key constraint exists on the column
      * or columns associated with this join. Specify "true" or "false".
-     * @return whether to generate or assume a primary key constraint
+     * @return whether to generate or assume a foreign key constraint
      */
     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/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=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Key.java Wed Aug 15 07:45:55 2007
@@ -82,13 +82,13 @@
      * Delete action to apply to the foreign key for the key.
      * @return delete action to apply to the foreign key for the key
      */
-    ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED;
 
     /**
      * Update action to apply to the foreign key for the key.
      * @return update action to apply to the foreign key for the key
      */
-    ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED;
 
     /**
      * Whether the value column(s) should be indexed.
@@ -127,12 +127,12 @@
 
     /** Generate or assume a foreign key constraint exists on the column
      * or columns associated with this join. Specify "true" or "false".
-     * @return whether to generate or assume a primary key constraint
+     * @return whether to generate or assume a foreign key constraint
      */
     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/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=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceCapable.java Wed Aug 15 07:45:55
2007
@@ -64,7 +64,7 @@
 
     /** Type of identity for this class or interface. 
      */
-    IdentityType identityType() default IdentityType.UNKNOWN;
+    IdentityType identityType() default IdentityType.UNSPECIFIED;
 
     /** Primary key class when using application identity and using own PK. 
      */

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/PersistenceModifier.java Wed Aug 15 07:45:55
2007
@@ -26,7 +26,7 @@
  */
 public enum PersistenceModifier
 {
-    UNKNOWN,
+    UNSPECIFIED,
     PERSISTENT,
     TRANSACTIONAL,
     NONE

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Persistent.java Wed Aug 15 07:45:55 2007
@@ -43,7 +43,7 @@
      * @return the persistence modifier
      */
     PersistenceModifier persistenceModifier() 
-        default PersistenceModifier.UNKNOWN;
+        default PersistenceModifier.UNSPECIFIED;
 
     /** Table to use for persisting this member.
      * @return the table to use for persisting this member
@@ -133,7 +133,14 @@
      * or property (if any).
      * @return the generated value strategy
      */
-    IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNKNOWN;
+    IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNSPECIFIED;
+
+    /** Custom value strategy to use to generate the value for this field 
+     * or property (if any). If customValueStrategy is non-empty, then
+     * valueStrategy must be UNSPECIFIED.
+     * @return the custom value strategy
+     */
+    String customValueStrategy() default "";
 
     /** Name of the sequence to use with particular value strategies. 
      * @return the name of the sequence

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=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Value.java Wed Aug 15 07:45:55 2007
@@ -81,13 +81,13 @@
      * Delete action to apply to any foreign key for the value.
      * @return delete action to apply to any foreign key for the value
      */
-    ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction deleteAction() default ForeignKeyAction.UNSPECIFIED;
 
     /**
      * Update action to apply to any foreign key for the value.
      * @return update action to apply to any foreign key for the value
      */
-    ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;
+    ForeignKeyAction updateAction() default ForeignKeyAction.UNSPECIFIED;
 
     /**
      * Whether the value column(s) should be indexed.
@@ -126,7 +126,7 @@
 
     /** Generate or assume a foreign key constraint exists on the column
      * or columns associated with this join. Specify "true" or "false".
-     * @return whether to generate or assume a primary key constraint
+     * @return whether to generate or assume a foreign key constraint
      */
     String generateForeignKey() default "";
 

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/Version.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/Version.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/Version.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/Version.java Wed Aug 15 07:45:55 2007
@@ -37,7 +37,14 @@
      * Strategy for versioning of objects of this class.
      * @return the strategy for versioning objects of this class
      */
-    VersionStrategy strategy();
+    VersionStrategy strategy() default VersionStrategy.UNSPECIFIED;
+
+    /**
+     * Custom strategy for versioning of objects of this class.
+     * If customStrategy is non-empty, strategy must be UNSPECIFIED.
+     * @return the custom strategy for versioning objects of this class
+     */
+    String customStrategy() default "";
 
     /**
      * Name of the column for the version.

Modified: db/jdo/trunk/api2/src/java/javax/jdo/annotations/VersionStrategy.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/annotations/VersionStrategy.java?view=diff&rev=566201&r1=566200&r2=566201
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/annotations/VersionStrategy.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/annotations/VersionStrategy.java Wed Aug 15 07:45:55
2007
@@ -24,6 +24,7 @@
  */
 public enum VersionStrategy
 {
+    UNSPECIFIED,
     NONE,
     STATE_IMAGE,
     DATE_TIME,



Mime
View raw message