Class TableSubquery

java.lang.Object
io.github.torand.fastersql.subquery.TableSubquery
All Implemented Interfaces:
Relation, Sql, Subquery

public class TableSubquery extends Object implements Subquery, Relation
Implements a subquery to be used in a FROM clause.
  • Constructor Details

    • TableSubquery

      public TableSubquery(SelectStatement query)
      Creates a table subquery.
      Parameters:
      query - the subquery.
  • Method Details

    • 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.
    • columnRefs

      public Stream<Column> columnRefs()
      Description copied from interface: Sql
      Gets the columns referenced by this fragment. For validation purposes.
      Specified by:
      columnRefs in interface Sql
      Returns:
      the columns referenced by this fragment.
    • aliasRefs

      public Stream<ColumnAlias> aliasRefs()
      Description copied from interface: Sql
      Gets the column aliases referenced by this fragment. For validation purposes.
      Specified by:
      aliasRefs in interface Sql
      Returns:
      the column aliases referenced by this fragment.
    • query

      public SelectStatement query()
      Description copied from interface: Subquery
      Gets the SELECT statement of this subquery.
      Specified by:
      query in interface Subquery
      Returns:
      the SELECT statement of this subquery.
    • as

      public TableSubquery as(String alias)
      Description copied from interface: Relation
      Specifies the table alias name of this relation.
      Specified by:
      as in interface Relation
      Parameters:
      alias - the table alias name.
      Returns:
      the modified relation.
    • alias

      public TableAlias alias()
      Description copied from interface: Relation
      Gets the table alias specified for this relation.
      Specified by:
      alias in interface Relation
      Returns:
      the table alias.