Class Table

java.lang.Object
io.github.torand.fastersql.model.Table
All Implemented Interfaces:
Relation, Sql
Direct Known Subclasses:
TableModel

public class Table extends Object implements Relation
Represents a database table.
  • Constructor Details

    • Table

      protected Table(String name)
      Creates a representation of a database table.
      Parameters:
      name - the table name.
    • Table

      protected Table(String name, String alias)
      Creates a representation of a database table.
      Parameters:
      name - the table name.
      alias - the table alias.
  • Method Details

    • name

      public String name()
      Gets the table name.
      Returns:
      the table name.
    • 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.
    • as

      public Table 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.