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
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of the direction a relationship can take. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSet this attribute to false if you don't want updates on an aggregate root to be cascaded to related objects.IfdirectionisRelationship.Direction.OUTGOING, than the attribute annotated withRelationshipwill be the target node of the relationship and the class containing the annotated attribute will be the start node.Returns the type of the relationship.Returns the type of the relationship.
-
Element Details
-
value
-
type
-
direction
Relationship.Direction directionIfdirectionisRelationship.Direction.OUTGOING, than the attribute annotated withRelationshipwill be the target node of the relationship and the class containing the annotated attribute will be the start node.If
directionisRelationship.Direction.INCOMING, than the attribute annotated withRelationshipwill 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
-