Enum Class CypherGenerator

java.lang.Object
java.lang.Enum<CypherGenerator>
org.springframework.data.neo4j.core.mapping.CypherGenerator
All Implemented Interfaces:
Serializable, Comparable<CypherGenerator>, Constable

@API(status=INTERNAL, since="6.0") public enum CypherGenerator extends Enum<CypherGenerator>
A generator based on the schema defined by node and relationship descriptions. Most methods return renderable Cypher statements.
Since:
6.0
Author:
Michael J. Simons, Gerrit Meier, Philipp Tölle
  • Enum Constant Details

  • Method Details

    • values

      public static CypherGenerator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CypherGenerator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • setElementIdOrIdFunction

      public void setElementIdOrIdFunction(Function<org.neo4j.cypherdsl.core.Named,org.neo4j.cypherdsl.core.FunctionInvocation> elementIdOrIdFunction)
      Set function to be used to query either elementId or id.
      Parameters:
      elementIdOrIdFunction - new function to use.
    • prepareMatchOf

      public org.neo4j.cypherdsl.core.StatementBuilder.OrderableOngoingReadingAndWith prepareMatchOf(NodeDescription<?> nodeDescription)
      Parameters:
      nodeDescription - The node description for which a match clause should be generated
      Returns:
      An ongoing match
      See Also:
    • prepareMatchOf

      public org.neo4j.cypherdsl.core.StatementBuilder.OrderableOngoingReadingAndWith prepareMatchOf(NodeDescription<?> nodeDescription, @Nullable org.neo4j.cypherdsl.core.Condition condition)
      This will create a match statement that fits the given node description and may contain additional conditions. The WITH clause of this statement contains all nodes and relationships necessary to map a record to the given nodeDescription.

      It is recommended to use Cypher.asterisk() to return everything from the query in the end.

      The root node is guaranteed to have the symbolic name n.

      Parameters:
      nodeDescription - The node description for which a match clause should be generated
      condition - Optional conditions to add
      Returns:
      An ongoing match
    • prepareMatchOf

      public org.neo4j.cypherdsl.core.StatementBuilder.OngoingReading prepareMatchOf(NodeDescription<?> nodeDescription, @Nullable List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition)
    • prepareMatchOf

      public org.neo4j.cypherdsl.core.StatementBuilder.OngoingReading prepareMatchOf(NodeDescription<?> nodeDescription, RelationshipDescription relationshipDescription, @Nullable List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition)
    • createRootNode

      @NonNull public org.neo4j.cypherdsl.core.Node createRootNode(NodeDescription<?> nodeDescription)
    • createStatementReturningDynamicLabels

      public org.neo4j.cypherdsl.core.Statement createStatementReturningDynamicLabels(NodeDescription<?> nodeDescription)
      Creates a statement that returns all labels of a node that are not part of a list parameter named Constants.NAME_OF_STATIC_LABELS_PARAM. Those are the "dynamic labels" of a node as set through SDN.
      Parameters:
      nodeDescription - The node description for which the statement should be generated
      Returns:
      A statement having one parameter.
      Since:
      6.0
    • prepareDeleteOf

      public org.neo4j.cypherdsl.core.Statement prepareDeleteOf(NodeDescription<?> nodeDescription)
    • prepareDeleteOf

      public org.neo4j.cypherdsl.core.Statement prepareDeleteOf(NodeDescription<?> nodeDescription, @Nullable org.neo4j.cypherdsl.core.Condition condition)
    • prepareDeleteOf

      public org.neo4j.cypherdsl.core.Statement prepareDeleteOf(NodeDescription<?> nodeDescription, @Nullable org.neo4j.cypherdsl.core.Condition condition, boolean count)
    • createCompositePropertyCondition

      public org.neo4j.cypherdsl.core.Condition createCompositePropertyCondition(GraphPropertyDescription idProperty, org.neo4j.cypherdsl.core.SymbolicName containerName, org.neo4j.cypherdsl.core.Expression actualParameter)
    • prepareSaveOf

      public org.neo4j.cypherdsl.core.Statement prepareSaveOf(NodeDescription<?> nodeDescription, UnaryOperator<org.neo4j.cypherdsl.core.StatementBuilder.OngoingMatchAndUpdate> updateDecorator, boolean canUseElementId)
    • prepareSaveOfMultipleInstancesOf

      public org.neo4j.cypherdsl.core.Statement prepareSaveOfMultipleInstancesOf(NodeDescription<?> nodeDescription)
    • prepareSaveOfRelationship

      @NonNull public org.neo4j.cypherdsl.core.Statement prepareSaveOfRelationship(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, @Nullable String dynamicRelationshipType, boolean canUseElementId)
    • prepareSaveOfRelationships

      @NonNull public org.neo4j.cypherdsl.core.Statement prepareSaveOfRelationships(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, @Nullable String dynamicRelationshipType, boolean canUseElementId)
    • prepareSaveOfRelationshipWithProperties

      @NonNull public org.neo4j.cypherdsl.core.Statement prepareSaveOfRelationshipWithProperties(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, @Nullable String dynamicRelationshipType, boolean canUseElementId)
    • prepareUpdateOfRelationshipsWithProperties

      @NonNull public org.neo4j.cypherdsl.core.Statement prepareUpdateOfRelationshipsWithProperties(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, boolean canUseElementId)
    • prepareDeleteOf

      @NonNull public org.neo4j.cypherdsl.core.Statement prepareDeleteOf(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationshipDescription, boolean canUseElementId)
    • createReturnStatementForExists

      public Collection<org.neo4j.cypherdsl.core.Expression> createReturnStatementForExists(Neo4jPersistentEntity<?> nodeDescription)
    • createReturnStatementForMatch

      public Collection<org.neo4j.cypherdsl.core.Expression> createReturnStatementForMatch(Neo4jPersistentEntity<?> nodeDescription)
    • createOrderByFragment

      @Nullable public String createOrderByFragment(@Nullable Sort sort)
      Creates an order by fragment, assuming the node to match is named `n`
      Parameters:
      sort - The sort that should be turned into a valid Cypher ORDER-clause
      Returns:
      An optional order clause. Will be null on sorts that are null or unsorted.
    • createReturnStatementForMatch

      public Collection<org.neo4j.cypherdsl.core.Expression> createReturnStatementForMatch(Neo4jPersistentEntity<?> nodeDescription, Predicate<PropertyFilter.RelaxedPropertyPath> includeField)
      Parameters:
      nodeDescription - Description of the root node
      includeField - A predicate derived from the set of included properties. This is only relevant in various forms of projections which allow to exclude one or more fields.
      Returns:
      An expression to be returned by a Cypher statement
    • createGenericReturnStatement

      public Collection<org.neo4j.cypherdsl.core.Expression> createGenericReturnStatement()