Optionality (enum)
Whether the property or parameter is optional or is required (aka mandatory).
API
enum Optionality {
DEFAULT (1)
OPTIONAL (2)
MANDATORY (3)
NOT_SPECIFIED (4)
boolean isOptional()
}
| 1 | DEFAULT
Default, usually meaning mandatory for properties and always meaning mandatory for parameters. |
| 2 | OPTIONAL
Indicates that the property or parameter is not required. |
| 3 | MANDATORY
Indicates that the property is required (even if the JDO |
| 4 | NOT_SPECIFIED
Ignore the value provided by this annotation (meaning that the framework will keep searching, in meta annotations or superclasses/interfaces). |
Members
DEFAULT
Default, usually meaning mandatory for properties and always meaning mandatory for parameters.
For properties, will be false unless JDO javax.jdo.annotations.Column has also specified with javax.jdo.annotations.Column#allowsNull() set to true .
MANDATORY
Indicates that the property is required (even if the JDO javax.jdo.annotations.Column annotation says otherwise).
When using the JDO/DataNucleus objectstore, it is sometimes necessary to annotate a property as optional (using javax.jdo.annotations.Column#allowsNull() set to true ), even if the property is logically mandatory. For example, this can occur when the property is in a subtype class that has been "rolled up" to the superclass table using javax.jdo.annotations.Inheritance > with the javax.jdo.annotations.InheritanceStrategy#SUPERCLASS_TABLE superclass strategy.
This annotation, therefore, is intended to override any objectstore-specific annotation, so that Causeway can apply the constraint even though the objectstore is unable to do so.