Class DBTableAlias
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
-
Field Summary
FieldsFields inherited from class adql.db.DBIdentifier
adqlCaseSensitive, adqlName, dbName
-
Constructor Summary
ConstructorsConstructorDescriptionDBTableAlias
(DBTable originTable, String tableAlias) Wrap the given table under the given ADQL/DB name. -
Method Summary
Modifier and TypeMethodDescriptionMakes a copy of this instance ofDBTable
, with the possibility to change the DB and ADQL names.Gets the ADQL name of the catalog which contains this table.Gets the ADQL name of the schema which contains this table.Gets the definition of the specified column if it exists in this table.Gets the DB name of the catalog which contains this table.Gets the DB name of the schema which contains this table.Get the aliased/wrapped table.iterator()
Methods inherited from class adql.db.DBIdentifier
denormalize, getADQLName, getDBName, isCaseSensitive, isDelimited, normalize, setADQLName, setCaseSensitive, setDBName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface adql.db.DBTable
getADQLName, getDBName, isCaseSensitive
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
columns
-
originTable
Wrapped table.
-
-
Constructor Details
-
DBTableAlias
Wrap the given table under the given ADQL/DB name.- Parameters:
originTable
- The table to wrap/alias.tableAlias
- The alias name.
-
-
Method Details
-
getOriginTable
Get the aliased/wrapped table.- Returns:
- The aliased table.
-
iterator
-
getADQLSchemaName
Description copied from interface:DBTable
Gets the ADQL name of the schema which contains this table.Warning! Same rules as
DBTable.getADQLName()
.- Specified by:
getADQLSchemaName
in interfaceDBTable
- Returns:
- ADQL name of its schema.
-
getDBSchemaName
Description copied from interface:DBTable
Gets the DB name of the schema which contains this table.Warning! Same rules as
DBTable.getDBName()
.- Specified by:
getDBSchemaName
in interfaceDBTable
- Returns:
- DB name of its schema.
-
getADQLCatalogName
Description copied from interface:DBTable
Gets the ADQL name of the catalog which contains this table.Warning! Same rules as
DBTable.getADQLName()
.- Specified by:
getADQLCatalogName
in interfaceDBTable
- Returns:
- ADQL name of its catalog.
-
getDBCatalogName
Description copied from interface:DBTable
Gets the DB name of the catalog which contains this table.Warning! Same rules as
DBTable.getDBName()
.- Specified by:
getDBCatalogName
in interfaceDBTable
- Returns:
- DB name of its catalog.
-
getColumn
Description copied from interface:DBTable
Gets the definition of the specified column if it exists in this table.- Specified by:
getColumn
in interfaceDBTable
- Parameters:
colName
- Name of the column (may be the ADQL or DB name depending of the second parameter).byAdqlName
-true
means the given name is the ADQL name of the column and that the research must be done on the ADQL name of columns,false
means the same thing but with the DB name.- Returns:
- The corresponding column, or NULL if the specified column had not been found.
-
copy
Description copied from interface:DBTable
Makes a copy of this instance ofDBTable
, with the possibility to change the DB and ADQL names.IMPORTANT:
- The given DB and ADQL name may be NULL. If NULL, the copy will contain exactly the same full name (DB and/or ADQL).
- they may be qualified (that's to say: prefixed by the schema name or by the catalog and schema name). It means that it is possible to change the catalog, schema and table name in the copy.
- they may be delimited (that's to say: written between double quotes to force case sensitivity).
For instance:
.copy(null, "foo")
=> a copy with the same full DB name, but with no ADQL catalog and schema name and with an ADQL table name equals to "foo".copy("schema.table", null)
=> a copy with the same full ADQL name, but with no DB catalog name, with a DB schema name equals to "schema" and with a DB table name equals to "table"
- Specified by:
copy
in interfaceDBTable
- Parameters:
dbName
- Its new DB name. It may be qualified and/or delimited. It may also be NULL ; if so, the full DB name won't be different in the copy.adqlName
- Its new ADQL name. It may be qualified and/or delimited. It may also be NULL ; if so, the full DB name won't be different in the copy.- Returns:
- A modified copy of this
DBTable
.
-