Annotation Interface Relationship
@Retention(RUNTIME)
@Target(FIELD)
@Documented
@Inherited
@API(status=STABLE,
since="6.0")
public @interface Relationship
Annotation to configure mappings of relationship.
- Since:
- 6.0
- Author:
- Michael J. Simons
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of the direction a relationship can take. -
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Set this attribute to false if you don't want updates on an aggregate root to be cascaded to related objects.Ifdirection
isRelationship.Direction.OUTGOING
, than the attribute annotated withRelationship
will be the target node of the relationship and the class containing the annotated attribute will be the start node.
-
Element Details
-
value
- Returns:
- See
type()
.
- Default:
- ""
-
type
- Returns:
- The type of the relationship.
- Default:
- ""
-
direction
Relationship.Direction directionIfdirection
isRelationship.Direction.OUTGOING
, than the attribute annotated withRelationship
will be the target node of the relationship and the class containing the annotated attribute will be the start node.If
direction
isRelationship.Direction.INCOMING
, than the attribute annotated withRelationship
will be the start node of the relationship and the class containing the annotated attribute will be the end node.- Returns:
- The direction of the relationship.
- Default:
- OUTGOING
-
cascadeUpdates
boolean cascadeUpdatesSet this attribute to false if you don't want updates on an aggregate root to be cascaded to related objects. Be aware that in this case you are responsible to manually save the related objects and that you might end up with a local object graph that is not in sync with the actual graph.- Returns:
- whether updates to the owning instance should be cascaded to the related objects
- Default:
- true
-