Interface PropagationConstraint

  • All Superinterfaces:
    Element, PropertyElement, Serializable
    All Known Implementing Classes:
    PropagationConstraintImpl

    @TypeMetadata(name="PropagationConstraint",
                  description="This type provides propagation constraint for **Relation** instances.\n\n- **`add`**:\n  - `propagate`: Adding the source **Resource** instance (or the **Relation** instance itself) to Context C recursively adds the target **Entity** instance to C.\n  - `unpropagate`: Adding the source **Resource** instance (or the **Relation** instance itself) to Context C does NOT add the target **Entity** instance to C.\n- **`remove`**:\n  - `cascade`: Removing the source **Resource** instance (or the **Relation** instance itself) from Context C recursively removes the target **Entity** instance from C.\n  - `cascadeWhenOrphan`: (Available for IsRelatedTo only) Removing the source **Resource** instance (or the IsRelatedTo instance itself) from Context C removes the target **Resource** instance from C only if the target **Resource** instance has no other incoming IsRelatedTo instances in Context C.\n  - `keep`: Removing the source **Resource** instance (or the **Relation** instance itself) from Context C does NOT remove the target **Entity** instance from C.",
                  version="2.0.0")
    @Change(version="2.0.0",description="Removed \'delete\' propagation constraint") @Change(version="1.1.0",description="Added \'delete\' propagation constraint") @Change(version="1.0.0",description="First Version")
    public interface PropagationConstraint
    extends PropertyElement
    Defines the propagation behavior for a relation when an 'add to context' or 'remove from context' event occurs on the source entity or the relation itself. The getRemoveConstraint() value also governs whether the target entity is cascade-deleted when the source entity or the relation itself is deleted outright, not merely removed from one context — there is no separate constraint for that scenario.

    The default propagation constraints are:

    • IsRelatedTo: add=unpropagate, remove=keep
    • ConsistsOf: add=propagate, remove=cascade
    Author:
    Luca Frosini (ISTI - CNR)
    See Also:
    PropertyElement