Package adql.db

## Class DBTableAlias

- java.lang.Object
- - adql.db.DefaultDBTable
  - - adql.db.DBTableAlias

- All Implemented Interfaces:
    `DBTable`, `java.lang.Iterable<DBColumn>`

      public class DBTableAlias
      extends DefaultDBTable

  This `DBTable` wraps another `DBTable` with a different ADQL and DB name.

  This wrapper aims to represent in the metadata the aliasing of a table. This table should not be part of any schema, in ADQL but also in SQL...it is just an alias of an existing table.

  All columns of the origin table are completely copied into this `DBTable` thanks to `DBColumn.copy(String, String, DBTable)`, with the same ADQL and DB name but a different parent table (this one is used of the original one).

  Note: The origin table is still available thanks to the function `getOriginTable()`.

  Since:
    1.4
  Version:
    1.4 (11/2017)
  Author:
    Grégory Mantelet (ARI)

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected DBTable` | `originTable` | Wrapped table.

    - ### Fields inherited from class adql.db.DefaultDBTable

      `adqlCatalogName, adqlName, adqlSchemaName, columns, dbCatalogName, dbName, dbSchemaName`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DBTableAlias​(DBTable originTable, java.lang.String tableAlias)` | Wrap the given table under the given ADQL/DB name.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DBTable` | `getOriginTable()` | Get the aliased/wrapped table.

    - ### Methods inherited from class adql.db.DefaultDBTable

      `addAllColumns, addColumn, copy, getADQLCatalogName, getADQLName, getADQLSchemaName, getColumn, getDBCatalogName, getDBName, getDBSchemaName, hasColumn, iterator, joinTableName, setADQLCatalogName, setADQLName, setADQLSchemaName, splitTableName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### originTable

          protected final DBTable originTable

      Wrapped table.

  - ### Constructor Detail

    - #### DBTableAlias

          public DBTableAlias​(DBTable originTable,
                              java.lang.String tableAlias)

      Wrap the given table under the given ADQL/DB name.
      Parameters:
        `originTable` - The table to wrap/alias.
        `tableAlias` - The alias name.

  - ### Method Detail

    - #### getOriginTable

          public DBTable getOriginTable()

      Get the aliased/wrapped table.
      Returns:
        The aliased table.