Class Neo4jSpelSupport

java.lang.Object
org.springframework.data.neo4j.repository.query.Neo4jSpelSupport

@API(status=INTERNAL, since="6.0.2") public final class Neo4jSpelSupport extends Object
This class provides a couple of extensions to the Spring Data Neo4j SpEL support. Its static functions are registered inside an EvaluationContextExtension that in turn will be provided as a root bean.
Since:
6.0.2
Author:
Michael J. Simons
  • Field Details

    • FUNCTION_LITERAL

      public static String FUNCTION_LITERAL
    • FUNCTION_ANY_OF

      public static String FUNCTION_ANY_OF
    • FUNCTION_ALL_OF

      public static String FUNCTION_ALL_OF
    • FUNCTION_ORDER_BY

      public static String FUNCTION_ORDER_BY
  • Constructor Details

    • Neo4jSpelSupport

      public Neo4jSpelSupport()
  • Method Details

    • orderBy

      Takes arg and tries to either extract a sort from it or cast it to a sort. That sort is than past to the CypherGenerator that renders a valid order by fragment which replaces the SpEL placeholder without further validation whether it's attributes are in the query or similar literal.
      Parameters:
      arg - The sort object to order the result set of the final query.
      Returns:
      A literal replacement for a SpEL placeholder
    • literal

      Turns the arguments of this function into a literal replacement for the SpEL placeholder (instead of creating Cypher parameters).
      Parameters:
      arg - The object that will be inserted as a literal String into the query. It's toString() method will be used.
      Returns:
      A literal replacement for a SpEL placeholder
    • anyOf

    • allOf

    • renderQueryIfExpressionOrReturnQuery

      public static String renderQueryIfExpressionOrReturnQuery(String query, Neo4jMappingContext mappingContext, EntityMetadata<?> metadata, SpelExpressionParser parser)
      Parameters:
      query - the query expression potentially containing a SpEL expression. Must not be null.
      metadata - the Neo4jPersistentEntity for the given entity. Must not be null.
      parser - Must not be null.
      Returns:
      A query in which some SpEL expression have been replaced with the result of evaluating the expression