public class DBCommonColumn extends java.lang.Object implements DBColumn
Modifier and Type | Field and Description |
---|---|
protected DBColumn |
generalColumnDesc |
protected java.util.ArrayList<DBTable> |
lstCoveredTables |
Constructor and Description |
---|
DBCommonColumn(DBColumn leftCol,
DBColumn rightCol)
Create a column which merges both of the given columns.
|
DBCommonColumn(DBCommonColumn toCopy,
java.lang.String dbName,
java.lang.String adqlName)
Constructor by copy.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCoveredTable(DBTable table)
Add a table that this common column must cover from now.
|
DBColumn |
copy(java.lang.String dbName,
java.lang.String adqlName,
DBTable dbTable)
WARNING: This copy function does not make a real copy of this DBCommonColumn !
It returns a modified copy of the general column description it contains.
|
java.lang.String |
getADQLName()
Gets the name of this column (without any prefix and double-quotes).
|
java.util.Iterator<DBTable> |
getCoveredTables()
Get an iterator over the list of all tables covered by this common column.
|
DBType |
getDatatype()
Get the type of this column (as closed as possible from the "database" type).
|
java.lang.String |
getDBName()
Gets the name of this column in the "database".
|
DBTable |
getTable()
Gets the table which contains this
DBColumn . |
protected DBColumn generalColumnDesc
protected java.util.ArrayList<DBTable> lstCoveredTables
public DBCommonColumn(DBColumn leftCol, DBColumn rightCol) throws UnresolvedJoinException
DBColumn
implementation is not associated with one table,
and can be listed in a DBTable
ONLY IF the latter is the result of a sub-query (see ADQLQuery.getResultingColumns()
).
A column resulting from a tables join is common only to the joined tables. That's why a list of all tables covered
by this column is created or update at each merge. It can be accessed thanks to getCoveredTables()
.
Note: In the case one or both of the columns to join are DBCommonColumn
, the list of their covered tables are also merged.leftCol
- Column of the left join table. May be a DBCommonColumn
.rightCol
- Column of the right join table. May be a DBCommonColumn
.UnresolvedJoinException
- If the type of the two given columns are not roughly (just testing numeric, string or geometry) compatible.public DBCommonColumn(DBCommonColumn toCopy, java.lang.String dbName, java.lang.String adqlName)
DBCommonColumn
.
Note: The list of covered tables is NOT deeply copied!toCopy
- The DBCommonColumn
to copy.dbName
- The new DB name of this DBCommonColumn
.adqlName
- The new ADQL name of this DBCommonColumn
.public final java.lang.String getADQLName()
DBColumn
getADQLName
in interface DBColumn
public final java.lang.String getDBName()
DBColumn
public final DBType getDatatype()
DBColumn
Get the type of this column (as closed as possible from the "database" type).
Note: The returned type should be as closed as possible from a type listed by the IVOA in the TAP protocol description into the section UPLOAD.
getDatatype
in interface DBColumn
public final DBTable getTable()
DBColumn
DBColumn
.public final java.util.Iterator<DBTable> getCoveredTables()
protected void addCoveredTable(DBTable table)
table
- Table to add in the covered tables list.public DBColumn copy(java.lang.String dbName, java.lang.String adqlName, DBTable dbTable)
DBCommonColumn(DBCommonColumn, String, String)
.copy
in interface DBColumn
dbName
- Its new DB name.adqlName
- Its new ADQL name.dbTable
- Its new DBTableDBColumn.copy(java.lang.String, java.lang.String, adql.db.DBTable)