Class MatchedClause

  • All Implemented Interfaces:
    MergeFragment, Fragment

    public class MatchedClause
    extends AbstractFragment
    implements MergeFragment
    Representation of the WHEN MATCHED part of an SQL MERGE statement.

    This class supports two different strategies, updating matching rows or deleting matching rows.

    • Constructor Detail

      • MatchedClause

        public MatchedClause​(Fragment root)
        Create a new instance of a MatchedClause.
        Parameters:
        root - root SQL statement this WHEN MATCHED clause belongs to
    • Method Detail

      • thenUpdate

        public MergeUpdateClause thenUpdate()
        Select updating as merge strategy for rows where that are considered matches between source and destination.
        Returns:
        update clause
      • hasUpdate

        public boolean hasUpdate()
        Check if the THEN UPDATE clause is present.
        Returns:
        true if the update clause is present
      • getUpdate

        public MergeUpdateClause getUpdate()
        Get the THEN UPDATE clause.
        Returns:
        THEN UPDATE clause
      • thenDelete

        public MergeDeleteClause thenDelete()
        Select deleting as merge strategy for rows where that are considered matches between source and destination.
        Returns:
        delete clause
      • hasDelete

        public boolean hasDelete()
        Check if the THEN DELETE clause is present.
        Returns:
        true if the delete clause is present.
      • getDelete

        public MergeDeleteClause getDelete()
        Get the THEN DELETE clause.
        Returns:
        THEN DELETE clause
      • accept

        public void accept​(MergeVisitor visitor)
        Description copied from interface: MergeFragment
        Accept a visitor (e.g. a renderer or validator).
        Specified by:
        accept in interface MergeFragment
        Parameters:
        visitor - visitor to accept