Package org.neo4j.cypherdsl.core
Class Clauses
- java.lang.Object
-
- org.neo4j.cypherdsl.core.Clauses
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClausecallClause(List<String> namespace, String name, @Nullable List<Expression> arguments, @Nullable List<Expression> resultItems, @Nullable Expression optionalWhere)Creates a CALL clause.static ClausecallClause(Statement statement)Creates a CALL {} sub-query clause.static @NotNull Clausecreate(List<PatternElement> patternElements)Builds aCREATEclause.static @NotNull 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, @Nullable String fieldTerminator)Creates anLOAD CSV clause.static @NotNull Clausematch(boolean optional, List<PatternElement> patternElements, @Nullable Expression optionalWhere, @Nullable List<Hint> optionalHints)Builds aMATCHclause.static @NotNull Clausemerge(List<PatternElement> patternElements, @Nullable List<MergeAction> mergeActions)Builds aMERGEclause.static Clauseremove(List<Expression> expressions)Creates aremove clause, removing labels or properties.static @NotNull Returnreturning(boolean distinct, List<Expression> expressions, @Nullable List<SortItem> optionalSortItems, @Nullable Expression optionalSkip, @Nullable 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 Clausewith(Return returnClause, @Nullable Expression optionalWhere)
-
-
-
Method Detail
-
match
@NotNull public static @NotNull Clause match(boolean optional, List<PatternElement> patternElements, @Nullable @Nullable Expression optionalWhere, @Nullable @Nullable List<Hint> optionalHints)
Builds aMATCHclause.- 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
-
delete
@NotNull public static @NotNull Clause delete(boolean detach, List<Expression> expressions)
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
@NotNull public static @NotNull Return returning(boolean distinct, List<Expression> expressions, @Nullable @Nullable List<SortItem> optionalSortItems, @Nullable @Nullable Expression optionalSkip, @Nullable @Nullable 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
@NotNull public static @NotNull Clause create(List<PatternElement> patternElements)
Builds aCREATEclause.- Parameters:
patternElements- The pattern elements to create- Returns:
- an immutable create clause
-
merge
@NotNull public static @NotNull Clause merge(List<PatternElement> patternElements, @Nullable @Nullable List<MergeAction> mergeActions)
Builds aMERGEclause.- Parameters:
patternElements- The pattern elements to mergemergeActions- An optional list ofmerge actions- Returns:
- an immutable merge clause
-
with
public static Clause with(Return returnClause, @Nullable @Nullable Expression optionalWhere)
- Parameters:
returnClause- The return clause that defines the fields, order and limit of what the with clause should returnoptionalWhere- An optional expression to define a where clause.- Returns:
- an immutable with clause
-
remove
public static Clause remove(List<Expression> expressions)
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
public static Clause set(List<Expression> expressions)
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
public static Clause unwind(Expression expression, SymbolicName name)
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, @Nullable @Nullable 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, @Nullable @Nullable List<Expression> arguments, @Nullable @Nullable List<Expression> resultItems, @Nullable @Nullable Expression 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
-
callClause
public static Clause callClause(Statement statement)
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 subquery.- Returns:
- An immutable subquery clause.
-
forEach
public static Clause forEach(SymbolicName v, Expression list, List<Clause> updatingClauses)
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
-
-