JDO
  1. JDO
  2. JDO-515

Allow custom settings for some annotation enum values

    Details

      Description

      JDO2.1 annotations utilise some enums defining the acceptable values for various strategies. The following need changing to allow implementations to provide custom values.

      @Persistence "valueStrategy", @DatastoreIdentity "strategy" are of the type IdGenerationStrategy. Changes required :
      1. IdGenerationStrategy needs UNKNOWN changing to UNSPECIFIED.
      2. @Persistence : add "customValueStrategy"
      3. @DatastoreIdentity : add "customStrategy"

      @Inheritance "strategy" is of type InheritanceStrategy. Changes required :
      1. InheritanceStrategy needs UNSPECIFIED adding.
      2. @Inheritance : change "strategy" to have default of UNSPECIFIED
      3. @Inheritance : add "customStrategy"

      1. jdo-515.patch
        11 kB
        Craig L Russell

        Issue Links

          Activity

          Hide
          Craig L Russell added a comment -

          I suppose we should change all of the defaults from UNKNOWN to UNSPECIFIED in all the annotations.
          [Bruiser:javax/jdo/annotations] clr% grep UNKNOWN *
          DatastoreIdentity.java: IdGeneratorStrategy strategy() default IdGeneratorStrategy.UNKNOWN;
          Discriminator.java: default DiscriminatorStrategy.UNKNOWN;
          DiscriminatorStrategy.java: UNKNOWN,
          Element.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
          Element.java: ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;
          ForeignKeyAction.java: UNKNOWN,
          IdGeneratorStrategy.java: UNKNOWN,
          IdentityType.java: UNKNOWN,
          Join.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
          Key.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
          Key.java: ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;
          PersistenceCapable.java: IdentityType identityType() default IdentityType.UNKNOWN;
          PersistenceModifier.java: UNKNOWN,
          Persistent.java: default PersistenceModifier.UNKNOWN;
          Persistent.java: IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNKNOWN;
          Value.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN;
          Value.java: ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;

          Show
          Craig L Russell added a comment - I suppose we should change all of the defaults from UNKNOWN to UNSPECIFIED in all the annotations. [Bruiser:javax/jdo/annotations] clr% grep UNKNOWN * DatastoreIdentity.java: IdGeneratorStrategy strategy() default IdGeneratorStrategy.UNKNOWN; Discriminator.java: default DiscriminatorStrategy.UNKNOWN; DiscriminatorStrategy.java: UNKNOWN, Element.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN; Element.java: ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN; ForeignKeyAction.java: UNKNOWN, IdGeneratorStrategy.java: UNKNOWN, IdentityType.java: UNKNOWN, Join.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN; Key.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN; Key.java: ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN; PersistenceCapable.java: IdentityType identityType() default IdentityType.UNKNOWN; PersistenceModifier.java: UNKNOWN, Persistent.java: default PersistenceModifier.UNKNOWN; Persistent.java: IdGeneratorStrategy valueStrategy() default IdGeneratorStrategy.UNKNOWN; Value.java: ForeignKeyAction deleteAction() default ForeignKeyAction.UNKNOWN; Value.java: ForeignKeyAction updateAction() default ForeignKeyAction.UNKNOWN;
          Hide
          Craig L Russell added a comment -

          This patch adds custom strategies to @DatastoreIdentity, @Discriminator, @Inheritance, @Persistent, and @Version. This is a bit more than the issue raises but is consistent with the concept that if there is a strategy, there might be a custom strategy.

          Please review to be sure I haven't missed anything.

          Show
          Craig L Russell added a comment - This patch adds custom strategies to @DatastoreIdentity, @Discriminator, @Inheritance, @Persistent, and @Version. This is a bit more than the issue raises but is consistent with the concept that if there is a strategy, there might be a custom strategy. Please review to be sure I haven't missed anything.

            People

            • Assignee:
              Craig L Russell
              Reporter:
              Andy Jefferson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development