Package adql.db
Class DefaultDBColumn
- java.lang.Object
-
- adql.db.DefaultDBColumn
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
adqlName
Name that this column must have in ADQL queries.protected java.lang.String
dbName
Name of the column in the "database".protected DBTable
table
Table in which this column exists.protected DBType
type
Type of the column in the "database".
-
Constructor Summary
Constructors Constructor Description DefaultDBColumn(java.lang.String dbName, DBTable table)
Builds a defaultDBColumn
with the given DB name and DB table.DefaultDBColumn(java.lang.String dbName, DBType type, DBTable table)
Builds a defaultDBColumn
with the given DB name and DB table.DefaultDBColumn(java.lang.String dbName, java.lang.String adqlName, DBTable table)
Builds a defaultDBColumn
with the given DB name, DB table and ADQL name.DefaultDBColumn(java.lang.String dbName, java.lang.String adqlName, DBType type, DBTable table)
Builds a defaultDBColumn
with the given DB name, DB table and ADQL name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DBColumn
copy(java.lang.String dbName, java.lang.String adqlName, DBTable dbTable)
Makes a copy of this instance ofDBColumn
.java.lang.String
getADQLName()
Gets the name of this column (without any prefix and double-quotes).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 thisDBColumn
.void
setADQLName(java.lang.String adqlName)
void
setDatatype(DBType type)
Set the type of this column.void
setTable(DBTable table)
-
-
-
Field Detail
-
dbName
protected java.lang.String dbName
Name of the column in the "database".
-
type
protected DBType type
Type of the column in the "database". Note: This should be one of the types listed by the IVOA in the TAP description.- Since:
- 1.3
-
table
protected DBTable table
Table in which this column exists.
-
adqlName
protected java.lang.String adqlName
Name that this column must have in ADQL queries.
-
-
Constructor Detail
-
DefaultDBColumn
public DefaultDBColumn(java.lang.String dbName, DBTable table)
Builds a defaultDBColumn
with the given DB name and DB table.- Parameters:
dbName
- Database column name (it will be also used for the ADQL name). Only the column name is expected. Contrary toDefaultDBTable
, if a whole column reference is given, no split will be done.table
- DB table which contains this column.- See Also:
DefaultDBColumn(String, String, DBType, DBTable)
-
DefaultDBColumn
public DefaultDBColumn(java.lang.String dbName, DBType type, DBTable table)
Builds a defaultDBColumn
with the given DB name and DB table.- Parameters:
dbName
- Database column name (it will be also used for the ADQL name). Only the column name is expected. Contrary toDefaultDBTable
, if a whole column reference is given, no split will be done.type
- Type of the column. Note: there is no default value. Consequently if this parameter is NULL, the type should be considered as unknown. It means that any comparison with any type will always return 'true'.table
- DB table which contains this column.- Since:
- 1.3
- See Also:
DefaultDBColumn(String, String, DBType, DBTable)
-
DefaultDBColumn
public DefaultDBColumn(java.lang.String dbName, java.lang.String adqlName, DBTable table)
Builds a defaultDBColumn
with the given DB name, DB table and ADQL name.- Parameters:
dbName
- Database column name. Only the column name is expected. Contrary toDefaultDBTable
, if a whole column reference is given, no split will be done.adqlName
- Column name used in ADQL queries. Only the column name is expected. Contrary toDefaultDBTable
, if a whole column reference is given, no split will be done.table
- DB table which contains this column.- See Also:
DefaultDBColumn(String, String, DBType, DBTable)
-
DefaultDBColumn
public DefaultDBColumn(java.lang.String dbName, java.lang.String adqlName, DBType type, DBTable table)
Builds a defaultDBColumn
with the given DB name, DB table and ADQL name.- Parameters:
dbName
- Database column name. Only the column name is expected. Contrary toDefaultDBTable
, if a whole column reference is given, no split will be done. REQUIRED parameter: it must be not NULL.adqlName
- Column name used in ADQL queries. Only the column name is expected. Contrary toDefaultDBTable
, if a whole column reference is given, no split will be done. If NULL, it will be set to dbName.type
- Type of the column. Note: there is no default value. Consequently if this parameter is NULL, the type should be considered as unknown. It means that any comparison with any type will always return 'true'.table
- DB table which contains this column.- Since:
- 1.3
-
-
Method Detail
-
getADQLName
public final java.lang.String getADQLName()
Description copied from interface:DBColumn
Gets the name of this column (without any prefix and double-quotes).- Specified by:
getADQLName
in interfaceDBColumn
- Returns:
- Its ADQL name.
-
setADQLName
public final void setADQLName(java.lang.String adqlName)
-
getDatatype
public final DBType getDatatype()
Description copied from interface: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.
- Specified by:
getDatatype
in interfaceDBColumn
- Returns:
- Its type.
-
setDatatype
public final void setDatatype(DBType type)
Set the type of this column.
Note 1: The given type should be as closed as possible from a type listed by the IVOA in the TAP protocol description into the section UPLOAD.
Note 2: there is no default value. Consequently if this parameter is NULL, the type should be considered as unknown. It means that any comparison with any type will always return 'true'.
- Parameters:
type
- New type of this column.- Since:
- 1.3
-
getDBName
public final java.lang.String getDBName()
Description copied from interface:DBColumn
Gets the name of this column in the "database".
-
getTable
public final DBTable getTable()
Description copied from interface:DBColumn
Gets the table which contains thisDBColumn
.
-
setTable
public final void setTable(DBTable table)
-
-