Enum Class CypherGenerator
- All Implemented Interfaces:
Serializable, Comparable<CypherGenerator>, Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionorg.neo4j.cypherdsl.core.ConditioncreateCompositePropertyCondition(GraphPropertyDescription idProperty, org.neo4j.cypherdsl.core.SymbolicName containerName, org.neo4j.cypherdsl.core.Expression actualParameter) Collection<org.neo4j.cypherdsl.core.Expression> createGenericReturnStatement(org.neo4j.cypherdsl.core.Expression... additionalExpressions) @Nullable StringcreateOrderByFragment(@Nullable Sort sort) Creates an order by fragment, assuming the node to match is named `n`.Collection<org.neo4j.cypherdsl.core.Expression> createReturnStatementForExists(Neo4jPersistentEntity<?> nodeDescription) Collection<org.neo4j.cypherdsl.core.Expression> createReturnStatementForMatch(Neo4jPersistentEntity<?> nodeDescription) Used for create statements from the (Reactive)Neo4jTemplate.Collection<org.neo4j.cypherdsl.core.Expression> createReturnStatementForMatch(Neo4jPersistentEntity<?> nodeDescription, Predicate<PropertyFilter.RelaxedPropertyPath> includeField, org.neo4j.cypherdsl.core.Expression... additionalExpressions) Creates a return statement for an ongoing match.org.neo4j.cypherdsl.core.NodecreateRootNode(NodeDescription<?> nodeDescription) org.neo4j.cypherdsl.core.StatementcreateStatementReturningDynamicLabels(NodeDescription<?> nodeDescription) Creates a statement that returns all labels of a node that are not part of a list parameter namedConstants.NAME_OF_STATIC_LABELS_PARAM.org.neo4j.cypherdsl.core.StatementprepareDeleteOf(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationshipDescription, boolean canUseElementId) org.neo4j.cypherdsl.core.StatementprepareDeleteOf(NodeDescription<?> nodeDescription) org.neo4j.cypherdsl.core.StatementprepareDeleteOf(NodeDescription<?> nodeDescription, @Nullable org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.StatementprepareDeleteOf(NodeDescription<?> nodeDescription, @Nullable org.neo4j.cypherdsl.core.Condition condition, boolean count) org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingprepareFindOf(NodeDescription<?> nodeDescription, List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.StatementBuilder.OrderableOngoingReadingAndWithprepareMatchOf(NodeDescription<?> nodeDescription) Prepares a match for a given entity.org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingprepareMatchOf(NodeDescription<?> nodeDescription, List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.StatementBuilder.OrderableOngoingReadingAndWithprepareMatchOf(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.org.neo4j.cypherdsl.core.StatementBuilder.OngoingReadingprepareMatchOf(NodeDescription<?> nodeDescription, RelationshipDescription relationshipDescription, @Nullable List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.StatementprepareSaveOf(NodeDescription<?> nodeDescription, UnaryOperator<org.neo4j.cypherdsl.core.StatementBuilder.OngoingMatchAndUpdate> updateDecorator, boolean canUseElementId) org.neo4j.cypherdsl.core.StatementprepareSaveOfMultipleInstancesOf(NodeDescription<?> nodeDescription) org.neo4j.cypherdsl.core.StatementprepareSaveOfRelationship(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, String dynamicRelationshipType, boolean canUseElementId) org.neo4j.cypherdsl.core.StatementprepareSaveOfRelationships(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, @Nullable String dynamicRelationshipType, boolean canUseElementId) org.neo4j.cypherdsl.core.StatementprepareSaveOfRelationshipWithProperties(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, @Nullable String dynamicRelationshipType, boolean canUseElementId, boolean matchOnly) org.neo4j.cypherdsl.core.StatementprepareUpdateOfRelationshipsWithProperties(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, boolean canUseElementId) voidsetElementIdOrIdFunction(Function<org.neo4j.cypherdsl.core.Named, org.neo4j.cypherdsl.core.FunctionInvocation> elementIdOrIdFunction) Set function to be used to query either elementId or id.static CypherGeneratorReturns the enum constant of this class with the specified name.static CypherGenerator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The sole instance of this generator.
-
-
Method Details
-
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
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 nameNullPointerException- 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) Prepares a match for a given entity.- 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. TheWITHclause of this statement contains all nodes and relationships necessary to map a record to the givennodeDescription.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 generatedcondition- an optional conditions to add- Returns:
- an ongoing match
-
prepareMatchOf
public org.neo4j.cypherdsl.core.StatementBuilder.OngoingReading prepareMatchOf(NodeDescription<?> nodeDescription, 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
-
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 namedConstants.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
-
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
public org.neo4j.cypherdsl.core.Statement prepareSaveOfRelationship(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, String dynamicRelationshipType, boolean canUseElementId) -
prepareSaveOfRelationships
public org.neo4j.cypherdsl.core.Statement prepareSaveOfRelationships(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, @Nullable String dynamicRelationshipType, boolean canUseElementId) -
prepareSaveOfRelationshipWithProperties
public org.neo4j.cypherdsl.core.Statement prepareSaveOfRelationshipWithProperties(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, @Nullable String dynamicRelationshipType, boolean canUseElementId, boolean matchOnly) -
prepareUpdateOfRelationshipsWithProperties
public org.neo4j.cypherdsl.core.Statement prepareUpdateOfRelationshipsWithProperties(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, boolean canUseElementId) -
prepareDeleteOf
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) Used for create statements from the (Reactive)Neo4jTemplate. This shouldn't be used for any find operations.- Parameters:
nodeDescription- persistentEntity- Returns:
- return expression for entity
-
createOrderByFragment
Creates an order by fragment, assuming the node to match is named `n`.- Parameters:
sort- thesortthat should be turned into a valid CypherORDER-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, org.neo4j.cypherdsl.core.Expression... additionalExpressions) Creates a return statement for an ongoing match.- Parameters:
nodeDescription- description of the root nodeincludeField- 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 fieldsadditionalExpressions- any additional expressions to add to the return statement- Returns:
- an expression to be returned by a Cypher statement
-
createGenericReturnStatement
public Collection<org.neo4j.cypherdsl.core.Expression> createGenericReturnStatement(org.neo4j.cypherdsl.core.Expression... additionalExpressions) -
prepareFindOf
public org.neo4j.cypherdsl.core.StatementBuilder.OngoingReading prepareFindOf(NodeDescription<?> nodeDescription, List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition)
-