java.lang.Object
org.neo4j.cypherdsl.core.Clauses
Builder / factory for various
clauses. It's mostly useful for building a
Cypher-DSL AST outside the fluent API.- Since:
- 2021.3.0
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClausecallClause(List<String> namespace, String name, List<Expression> arguments, List<Expression> resultItems, Where optionalWhere) Creates a CALL clause.static ClausecallClause(Statement statement) Creates a CALL {} sub-query clause.static Clausecreate(List<PatternElement> patternElements) Builds aCREATEclause.static Clausedelete(boolean detach, List<Expression> expressions) Builds aDELETEclause.static ClauseforEach(SymbolicName v, Expression list, List<Clause> updatingClauses) Creates a literal for each clause.static ClauseloadCSV(boolean withHeaders, StringLiteral uri, SymbolicName alias, String fieldTerminator) Creates anLOAD CSV clause.static Clausematch(boolean optional, List<PatternElement> patternElements, Where optionalWhere, List<Hint> optionalHints) Builds aMATCHclause.static Clausemerge(List<PatternElement> patternElements, List<MergeAction> mergeActions) Builds aMERGEclause.static ClauseorderBy(List<SortItem> sortItems, Expression skip, Expression limit) Creates a standaloneORDER BYclause.static Clauseremove(List<Expression> expressions) Creates aremove clause, removing labels or properties.static Returnreturning(boolean distinct, List<Expression> expressions, List<SortItem> optionalSortItems, Expression optionalSkip, Expression optionalLimit) Builds aRETURNclause.static Clauseset(List<Expression> expressions) Creates aremove clause, setting labels or properties.static Clauseunwind(Expression expression, SymbolicName name) Creates anunwind clause.static Clause
-
Method Details
-
match
public static Clause match(boolean optional, List<PatternElement> patternElements, Where optionalWhere, List<Hint> optionalHints) Builds aMATCHclause. The result can be safely cast to aMatchif needed.- Parameters:
optional- should this be an optional match?patternElements- the pattern elements to matchoptionalWhere- an optional where sub-clauseoptionalHints- optional hints to be used- Returns:
- an immutable match clause
- Since:
- 2022.0.0
-
delete
Builds aDELETEclause.- Parameters:
detach- should this be an detach delete?expressions- the expressions pointing to the things to be deleted- Returns:
- an immutable delete clause
-
returning
public static Return returning(boolean distinct, List<Expression> expressions, List<SortItem> optionalSortItems, Expression optionalSkip, Expression optionalLimit) Builds aRETURNclause.- Parameters:
distinct- should this be a distinct returnexpressions- the expressions to be returnedoptionalSortItems- an optional list of sort itemsoptionalSkip- an optionalNumberLiteralof how many items to skipoptionalLimit- an optionalNumberLiteralof how many items to be returned- Returns:
- an immutable return clause
-
create
Builds aCREATEclause.- Parameters:
patternElements- the pattern elements to create- Returns:
- an immutable create clause
-
merge
Builds aMERGEclause.- Parameters:
patternElements- the pattern elements to mergemergeActions- an optional list ofmerge actions- Returns:
- an immutable merge clause
-
with
- Parameters:
returnClause- the return clause that defines the fields, order and limit of what the with clause should returnoptionalWhere- an optional WHERE expression to define a where clause.- Returns:
- an immutable with clause
- Since:
- 2022.0.0
-
remove
Creates aremove clause, removing labels or properties.- Parameters:
expressions- expressions pointing to a list of properties or labels that shall be removed- Returns:
- an immutable remove clause
-
set
Creates aremove clause, setting labels or properties.- Parameters:
expressions- expressions pointing to a list of properties or labels that shall be set- Returns:
- an immutable set clause
-
unwind
Creates anunwind clause.- Parameters:
expression- the expression to unwindname- the name on which to unwind- Returns:
- an immutable unwind clause
-
loadCSV
public static Clause loadCSV(boolean withHeaders, StringLiteral uri, SymbolicName alias, String fieldTerminator) Creates anLOAD CSV clause.- Parameters:
withHeaders- set to true to render the WITH HEADERS optionsuri- the source to load fromalias- the alias for the linesfieldTerminator- the field terminator- Returns:
- an immutable clause
-
callClause
public static Clause callClause(List<String> namespace, String name, List<Expression> arguments, List<Expression> resultItems, Where optionalWhere) Creates a CALL clause.- Parameters:
namespace- an optional namespace, maybe emptyname- the name of the stored procedure to callarguments- the arguments, maybe null or emptyresultItems- the result items, maybe null or emptyoptionalWhere- an optional where- Returns:
- an immutable clause
- Since:
- 2022.0.0
-
callClause
Creates a CALL {} sub-query clause. No checking is done whether the statement passed in returns anything meaningful so that the resulting clause will be runnable or not.- Parameters:
statement- a statement to be used inside the sub-query.- Returns:
- an immutable sub-query clause.
-
forEach
Creates a literal for each clause.- Parameters:
v- the name of the variable that should be available in the list of updating clauseslist- the list on which to iterateupdatingClauses- the updating clauses- Returns:
- an immutable foreach clause
-
orderBy
Creates a standaloneORDER BYclause.- Parameters:
sortItems- the items to sort byskip- a literal number item specifying the skipped items, may be nulllimit- a literal number item specifying the total limit of items, may be null- Returns:
- an immutable order by clause
- Since:
- 2024.7.4
-