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 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionorg.neo4j.cypherdsl.core.Condition
createCompositePropertyCondition
(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) createOrderByFragment
(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) Collection<org.neo4j.cypherdsl.core.Expression>
createReturnStatementForMatch
(Neo4jPersistentEntity<?> nodeDescription, Predicate<PropertyFilter.RelaxedPropertyPath> includeField, org.neo4j.cypherdsl.core.Expression... additionalExpressions) org.neo4j.cypherdsl.core.Node
createRootNode
(NodeDescription<?> nodeDescription) 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
.org.neo4j.cypherdsl.core.Statement
prepareDeleteOf
(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationshipDescription, boolean canUseElementId) org.neo4j.cypherdsl.core.Statement
prepareDeleteOf
(NodeDescription<?> nodeDescription) org.neo4j.cypherdsl.core.Statement
prepareDeleteOf
(NodeDescription<?> nodeDescription, org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.Statement
prepareDeleteOf
(NodeDescription<?> nodeDescription, org.neo4j.cypherdsl.core.Condition condition, boolean count) org.neo4j.cypherdsl.core.StatementBuilder.OngoingReading
prepareFindOf
(NodeDescription<?> nodeDescription, List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.StatementBuilder.OrderableOngoingReadingAndWith
prepareMatchOf
(NodeDescription<?> nodeDescription) org.neo4j.cypherdsl.core.StatementBuilder.OngoingReading
prepareMatchOf
(NodeDescription<?> nodeDescription, List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.StatementBuilder.OrderableOngoingReadingAndWith
prepareMatchOf
(NodeDescription<?> nodeDescription, 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.OngoingReading
prepareMatchOf
(NodeDescription<?> nodeDescription, RelationshipDescription relationshipDescription, List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, org.neo4j.cypherdsl.core.Condition condition) org.neo4j.cypherdsl.core.Statement
prepareSaveOf
(NodeDescription<?> nodeDescription, UnaryOperator<org.neo4j.cypherdsl.core.StatementBuilder.OngoingMatchAndUpdate> updateDecorator, boolean canUseElementId) org.neo4j.cypherdsl.core.Statement
prepareSaveOfMultipleInstancesOf
(NodeDescription<?> nodeDescription) org.neo4j.cypherdsl.core.Statement
prepareSaveOfRelationship
(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, String dynamicRelationshipType, boolean canUseElementId) org.neo4j.cypherdsl.core.Statement
prepareSaveOfRelationships
(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, String dynamicRelationshipType, boolean canUseElementId) org.neo4j.cypherdsl.core.Statement
prepareSaveOfRelationshipWithProperties
(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, String dynamicRelationshipType, boolean canUseElementId, boolean matchOnly) org.neo4j.cypherdsl.core.Statement
prepareUpdateOfRelationshipsWithProperties
(Neo4jPersistentEntity<?> neo4jPersistentEntity, RelationshipDescription relationship, boolean isNew, boolean canUseElementId) 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.static CypherGenerator
Returns 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
-
-
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) - 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. TheWITH
clause 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
- 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
-
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
@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, boolean matchOnly) -
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
Creates an order by fragment, assuming the node to match is named `n`- Parameters:
sort
- Thesort
that 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) - 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 fields.additionalExpressions
- 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, @Nullable List<org.neo4j.cypherdsl.core.PatternElement> initialMatchOn, @Nullable org.neo4j.cypherdsl.core.Condition condition)
-