Class Expressions

java.lang.Object
org.neo4j.cypherdsl.core.Expressions

@API(status=STABLE, since="1.0") public final class Expressions extends Object
Utility methods for dealing with expressions.
Since:
1.0
Author:
Michael J. Simons
  • Method Details

    • count

      @NotNull public static @NotNull CountExpression count(PatternElement requiredPattern, PatternElement... patternElement)
      Creates a COUNT sub-query expressions from at least one pattern.
      Parameters:
      requiredPattern - One pattern is required
      patternElement - Optional pattern
      Returns:
      The immutable CountExpression
      Since:
      2023.0.0
    • count

      @NotNull public static @NotNull CountExpression count(Statement.UnionQuery union)
      Creates a COUNT with an inner UNION sub-query.
      Parameters:
      union - The union that will be the source of the COUNT sub-query
      Returns:
      The immutable CountExpression
      Since:
      2023.0.0
    • count

      @NotNull public static @NotNull CountExpression count(Statement statement, IdentifiableElement... imports)
      Creates a COUNT from a full statement, including its filters and conditions. The statement may or may not have a RETURN clause. It must however not contain any updates. While it would render syntactically correct Cypher, Neo4j does not support updates inside counting sub-queries.
      Parameters:
      statement - The statement to be passed to count{}
      imports - Optional imports to be used in the statement (will be imported with WITH)
      Returns:
      A counting sub-query.
      Since:
      2023.1.0
    • with

      public static Expressions.SubqueryExpressionBuilder with(String... identifiableElements)
      Start building a new sub-query expression by importing variables into the scope with a WITH clause.
      Parameters:
      identifiableElements - The identifiable elements to import
      Returns:
      A builder for creating the concrete sub-query
      Since:
      2023.0.0
    • with

      public static Expressions.SubqueryExpressionBuilder with(IdentifiableElement... identifiableElements)
      Start building a new sub-query expression by importing variables into the scope with a WITH clause.
      Parameters:
      identifiableElements - The identifiable elements to import
      Returns:
      A builder for creating the concrete sub-query
      Since:
      2023.0.0