Class DeleteRelationshipCommand

  • All Implemented Interfaces:
    ExecutableCommand

    public class DeleteRelationshipCommand
    extends ExecutableCommandWrapper
    implements ExecutableCommand
    Deletes an existing relationship between Items in the Integrity database.

    Constraints:

    • The FieldValue must be owned by its source Item.
    • The FieldValue must reference a Field.
    • All Items (either source or targets of the relation) must already exist in the database.

    Notes:

    • You might want to group the execution of multiple updates using a CompoundCommand.

    Usage:

     new DeleteRelationshipCommand(myValue, myTargetItem).execute();
     
    See Also:
    CompoundCommand
    • Constructor Detail

      • DeleteRelationshipCommand

        public DeleteRelationshipCommand​(FieldValue fieldValue,
                                         Element targetElement)
        Instantiates a command to delete a relationship.
        Parameters:
        fieldValue - the field value which references a relation to delete.
        targetElement - the target element to remove from the relationship.
      • DeleteRelationshipCommand

        public DeleteRelationshipCommand​(FieldValue fieldValue,
                                         Collection<? extends Element> targetElements)
        Instantiates a command to delete a relationship.
        Parameters:
        fieldValue - the field value which references a relation to delete.
        targetElements - the target elements to remove from the relationship.