Class Expressions

java.lang.Object
org.springframework.data.relational.core.sql.Expressions

public abstract class Expressions extends Object
Factory for common Expressions.
Since:
1.1
Author:
Mark Paluch, Jens Schauder
See Also:
  • Method Details

    • asterisk

      public static Expression asterisk()
      Returns:
      a new asterisk * expression.
    • just

      public static Expression just(String sql)
      Creates a plain sql Expression.
      Parameters:
      sql - the SQL, must not be null or empty.
      Returns:
      a SQL Expression.
    • asterisk

      public static Expression asterisk(Table table)
      Returns:
      a new Table.scoped asterisk <table>.* expression.
    • cast

      public static Expression cast(Expression expression, String targetType)
      Returns:
      a new Cast expression.
      Since:
      2.3
    • of

      public static Expression of(List<Column> columns)
      Creates an Expression based on the provided list of Columns.

      If the list contains only a single column, this method returns that column directly as the resulting Expression. Otherwise, it creates and returns a TupleExpression that represents multiple columns as a single expression.

      Parameters:
      columns - the list of Columns to include in the expression; must not be null.
      Returns:
      an Expression corresponding to the input columns: either a single column or a TupleExpression for multiple columns.
      Since:
      4.0