Class MergeAction

java.lang.Object
org.neo4j.cypherdsl.core.MergeAction
All Implemented Interfaces:
Visitable

@API(status=STABLE, since="2020.1.2") public final class MergeAction extends Object implements Visitable
An action or event that happens after a MERGE clause. It can either be one of two types: MergeAction.Type.ON_CREATE or MergeAction.Type.ON_MATCH.

Both events supports the setting of properties, but not removing or adding labels. Multiple properties should be set in one action, but Cypher and openCypher allow for multiple merge actions, with the same or different types.

Since:
2020.1.2
Author:
Michael J. Simons
  • Method Details

    • toString

      public String toString()
      Description copied from interface: Visitable
      Most visitables will render themselves into a Cypher fragment preceded with the actual classname. The representation however is not cached - in contrast to the ones for full statements. Using toString is recommended for debugging purposes mainly, and not for production use.

      The concrete classname has been prepended to help debugging and actually to discourage using fragments to build queries without explicitly rendering them, either as statement or going through the renderer on purpose.

      Specified by:
      toString in interface Visitable
      Overrides:
      toString in class Object
      Returns:
      A string representation of this visitable formatted as Classname{cypher=value}
    • of

      public static MergeAction of(MergeAction.Type type, Set set)
      Creates a new merge action. Mostly useful when building the AST outside the fluent DSL.
      Parameters:
      type - The type of the action
      set - The corresponding updating clause
      Returns:
      An immutable action
      Since:
      2021.3.0
    • getType

      @API(status=INTERNAL) public MergeAction.Type getType()
      Returns:
      Event type of this action.
    • accept

      public void accept(Visitor visitor)
      Description copied from interface: Visitable
      Accept a Visitor visiting this Visitable and its nested Visitables if applicable.
      Specified by:
      accept in interface Visitable
      Parameters:
      visitor - the visitor to notify, must not be null.