Class AliasableSqlTable<T extends AliasableSqlTable<T>>

java.lang.Object
org.mybatis.dynamic.sql.SqlTable
org.mybatis.dynamic.sql.AliasableSqlTable<T>
All Implemented Interfaces:
TableExpression

public abstract class AliasableSqlTable<T extends AliasableSqlTable<T>> extends SqlTable
  • Constructor Details

    • AliasableSqlTable

      protected AliasableSqlTable(String tableName, Supplier<T> constructor)
  • Method Details

    • withAlias

      public T withAlias(String alias)
    • withName

      public T withName(String name)
      Returns a new instance of this table with the specified name. All column instances are recreated. This is useful for sharding where the table name may change at runtime based on some sharding algorithm, but all other table attributes are the same.
      Parameters:
      name - new name for the table
      Returns:
      a new AliasableSqlTable with the specified name, all other table attributes are copied
    • tableAlias

      public Optional<String> tableAlias()
      Overrides:
      tableAlias in class SqlTable