Class SelectSetOpStatement

java.lang.Object
io.github.torand.fastersql.statement.SelectSetOpStatement
All Implemented Interfaces:
Sql, PreparableStatement

public class SelectSetOpStatement extends Object implements PreparableStatement
Implements a SELECT statement with set operations.
  • Method Details

    • orderBy

      public SelectSetOpStatement orderBy(Order... orders)
      Adds one or more ORDER clauses.
      Parameters:
      orders - the ORDER clauses.
      Returns:
      the modified statement.
    • union

      public SelectSetOpStatement union(SelectStatement operand)
      Creates a UNION set operation between this and the specified statement.
      Parameters:
      operand - the set operation operand.
      Returns:
      the modified statement.
    • unionAll

      public SelectSetOpStatement unionAll(SelectStatement operand)
      Creates a UNION ALL set operation between this and the specified statement.
      Parameters:
      operand - the set operation operand.
      Returns:
      the modified statement.
    • intersect

      public SelectSetOpStatement intersect(SelectStatement operand)
      Creates an INTERSECT set operation between this and the specified statement. Note that INTERSECT has precedence over UNION and EXCEPT.
      Parameters:
      operand - the set operation operand.
      Returns:
      the modified statement.
    • intersectAll

      public SelectSetOpStatement intersectAll(SelectStatement operand)
      Creates an INTERSECT ALL set operation between this and the specified statement. Note that INTERSECT has precedence over UNION and EXCEPT.
      Parameters:
      operand - the set operation operand.
      Returns:
      the modified statement.
    • except

      public SelectSetOpStatement except(SelectStatement operand)
      Creates an EXCEPT set operation between this and the specified statement.
      Parameters:
      operand - the set operation operand.
      Returns:
      the modified statement.
    • exceptAll

      public SelectSetOpStatement exceptAll(SelectStatement operand)
      Creates an EXCEPT ALL set operation between this and the specified statement.
      Parameters:
      operand - the set operation operand.
      Returns:
      the modified statement.
    • sql

      public String sql(Context context)
      Description copied from interface: Sql
      Formats object as an SQL fragment.
      Specified by:
      sql in interface Sql
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the formatted SQL fragment.
    • params

      public Stream<Object> params(Context context)
      Description copied from interface: Sql
      Gets the statement parameters introduced by this fragment.
      Specified by:
      params in interface Sql
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the statement parameters.
    • toString

      public String toString()
      Overrides:
      toString in class Object