com.jadeworld.jade.persistence
Annotation Type OneToMany
@Retention(value=RUNTIME)
@Target(value={FIELD,METHOD})
public @interface OneToMany
Indicates a many-to-one relationship.
It must be specified for a property annotated with @DbProperty that is a reference to a
class which inherits from com.jadeworld.jade.rootschema.Collection.
- Author:
- JADE Development Centre, Jade Software Corporation Ltd.
relationshipType
public abstract ReferenceRelationshipType relationshipType
- relationshipType sets the type of relationship for the property.
A peer-to-peer (PEER) relationship is an equivalent relationship between two objects.
A parent-child relationship is a relationship in which the child object belongs to or is subsidiary to the parent object.
When a parent object is deleted, any child objects are automatically deleted.
The relationship is between instances of two classes.
A value of PARENT sets this property as the parent and the inverse property as the child.
A value of CHILD sets this property as the child and the inverse property as the parent.
- Default:
- PEER
updateMode
public abstract ReferenceUpdateMode updateMode
- updateMode determines what is automatically done by JADE and what is done by user logic.
The MANUAL option specifies that the property is maintained by your Java logic.
The AUTOMATIC option means the property is maintained by JADE whenever the property at the other end of the
relationship (the inverse) is updated. Automatic references cannot be updated in user logic.
The MAN_AUTO option specifies that either end of the relationship can be updated in user logic.
The other side of the relationship is automatically maintained by JADE.
The DEFAULT option means that a peer-to-peer relationship is MAN_AUTO,
A parent relationship is AUTOMATIC and a child relationship is MANUAL.
- Default:
- DEFAULT
constraint
public abstract java.lang.String constraint
- Optional. The name of a condition method which applies as a constraint.
It applies only if the updateMode is AUTOMATIC.
When the manual side of an inverse reference is set, the property on the automatic side of the reference
is set only when this constraint is satisfied.
- Default:
- ""
inverse
public abstract java.lang.String inverse
- The Java name of the inverse property.
- Default:
- ""
transientToPersistentAllowed
public abstract boolean transientToPersistentAllowed
- Optional. Set to true to allow transient instances to reference a persistent instance.
In this case, no inverses are updated.
- Default:
- false
inverseNotRequired
public abstract boolean inverseNotRequired
- Optional. Set to true to specify that no exception is raised when no inverse is set during automatic maintenance
because the type of the object is not compatible with any of the inverse references or when no inverse is set during
automatic maintenance because the constraint fails.
- Default:
- false
exclusive
public abstract boolean exclusive
- Optional. If true, the collection is created and destroyed automatically when the parent object is created and destroyed.
If false, the collection is an independent object.
The default is false unless there is an inverse defined, when it becomes true regardless of this setting.
- Default:
- true
Copyright © 2007 Jade Software Corporation