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

public abstract class SQL extends Object
Utility to create SQL Segments. Typically used as entry point to the Statement Builder. Objects and dependent objects created by the Query AST are immutable except for builders.

The Statement Builder API is intended for framework usage to produce SQL required for framework operations.

Since:
1.1
Author:
Mark Paluch, Jens Schauder
See Also:
  • Method Details

    • column

      public static Column column(String name, Table table)
      Creates a new Column associated with a source Table.
      Parameters:
      name - column name, must not be null or empty.
      table - table name, must not be null.
      Returns:
      the column with name associated with Table.
    • table

      public static Table table(String name)
      Creates a new Table.
      Parameters:
      name - table name, must not be null or empty.
      Returns:
      the column with name.
    • bindMarker

      public static BindMarker bindMarker()
      Creates a new parameter bind marker.
      Returns:
      a new BindMarker.
    • bindMarker

      public static BindMarker bindMarker(String name)
      Creates a new parameter bind marker associated with a name hint.
      Parameters:
      name - name hint, must not be null or empty.
      Returns:
      a new BindMarker.
    • literalOf

      public static BooleanLiteral literalOf(boolean value)
      Creates a new BooleanLiteral rendering either TRUE or FALSE depending on the given value.
      Parameters:
      value - the literal content.
      Returns:
      a new BooleanLiteral.
      Since:
      2.0
    • literalOf

      public static StringLiteral literalOf(@Nullable CharSequence content)
      Creates a new StringLiteral from the content.
      Parameters:
      content - the literal content.
      Returns:
      a new StringLiteral.
    • literalOf

      public static NumericLiteral literalOf(@Nullable Number content)
      Creates a new NumericLiteral from the content.
      Parameters:
      content - the literal content.
      Returns:
      a new NumericLiteral.
    • literalOf

      public static <T> Literal<T> literalOf(@Nullable T content)
      Creates a new Literal from the content.
      Parameters:
      content - the literal content.
      Returns:
      a new Literal.
    • nullLiteral

      public static <T> Literal<T> nullLiteral()
      Creates a new NULL Literal.
      Returns:
      a new Literal.