Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-488

Derive Isis' MandatoryFacet from JDO @Column(allowNulls=) annotation, and provide @Mandatory annotation as override

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • objectstore-jdo-1.1.0
    • objectstore-jdo-1.3.0
    • Persistence JDO
    • None

    Description

      Thus:

      @javax.jdo.annotations.Column(allowNulls="false")
      public String getFoo()

      { ... }

      is mandatory

      @javax.jdo.annotations.Column(allowNulls="true")
      public String getFoo() { ... }

      is optional

      @javax.jdo.annotations.Column
      public int getFoo()

      { ... }

      is mandatory (JDO default for primitives)

      @javax.jdo.annotations.Column
      public String getFoo() { ... }

      is optional (JDO default for non-primitives)

      ~~~

      In certain circumstances (when using roll-up SUPERCLASS_TABLE inheritance) it is necessary to annotate a mandatory property as optional in JDO. To force Isis to implement a mandatory check, use the @Mandatory annotation

      eg:

      @javax.jdo.annotations.Inheritance(strategy = InheritanceStrategy.SUPERCLASS_TABLE)
      public class SomeSubclass {

      @javax.jdo.annotations.Column(allowNulls="false")
      @Mandatory
      public String getFoo()

      { ... }

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: