Class DefaultDBColumn
- All Implemented Interfaces:
DBColumn
DBColumn
.
WARNING: constructors signature and behavior changed since v2.0!
Before v2.0, the constructors expected to have the DB names before the ADQL
names and thus, they forced to give a DB column name ; the ADQL column name
being optional (if not provided it was set to the DB name).
But since v2.0, this logic is inverted: the ADQL name is mandatory (a
NullPointerException
will be thrown if NULL or empty) while the DB
name is optional (DBIdentifier.getDBName()
will return the same as
DBIdentifier.getADQLName()
if no DB name is specified at initialization).
Consequently, the ADQL names are expected as first parameters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DBTable
Table in which this column exists.protected DBType
Type of the column in the "database".Fields inherited from class adql.db.DBIdentifier
adqlCaseSensitive, adqlName, dbName
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDBColumn
(String adqlName, DBTable table) Builds a defaultDBColumn
with the given ADQL name and table.DefaultDBColumn
(String adqlName, DBType type, DBTable table) Builds a defaultDBColumn
with the given ADQL name and table.DefaultDBColumn
(String adqlName, String dbName, DBTable table) Builds a defaultDBColumn
with the given ADQL and DB names and table.DefaultDBColumn
(String adqlName, String dbName, DBType type, DBTable table) Builds a defaultDBColumn
with the given ADQL and DB names, type and table -
Method Summary
Modifier and TypeMethodDescriptionMakes a copy of this instance ofDBColumn
.final DBType
Get the type of this column (as closed as possible from the "database" type).final DBTable
getTable()
Gets the table which contains thisDBColumn
.final void
setDatatype
(DBType type) Set the type of this column.final void
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.DBColumn
getADQLName, getDBName, isCaseSensitive
-
Field Details
-
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
Table in which this column exists.
-
-
Constructor Details
-
DefaultDBColumn
Builds a defaultDBColumn
with the given ADQL name and table.With this constructor: DB name = ADQL name.
- Parameters:
adqlName
- The ADQL name of this column (i.e. name to use in ADQL).table
- Table which contains this column.- Throws:
NullPointerException
- If the given ADQL name is NULL or empty.- Since:
- 2.0
-
DefaultDBColumn
Builds a defaultDBColumn
with the given ADQL name and table.- Parameters:
adqlName
- The ADQL name of this column (i.e. name to use in ADQL).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 returntrue
.table
- Table which contains this column.- Throws:
NullPointerException
- If the given ADQL name is NULL or empty.- Since:
- 2.0
-
DefaultDBColumn
Builds a defaultDBColumn
with the given ADQL and DB names and table.- Parameters:
adqlName
- The ADQL name of this column (i.e. name to use in ADQL).dbName
- Database name. If NULL,DBIdentifier.getDBName()
will return the same asDBIdentifier.getADQLName()
.table
- Table which contains this column.- Throws:
NullPointerException
- If the given ADQL name is NULL or empty.- Since:
- 2.0
-
DefaultDBColumn
public DefaultDBColumn(String adqlName, String dbName, DBType type, DBTable table) throws NullPointerException Builds a defaultDBColumn
with the given ADQL and DB names, type and table- Parameters:
adqlName
- The ADQL name of this column (i.e. name to use in ADQL).dbName
- Database name. If NULL,DBIdentifier.getDBName()
will return the same asDBIdentifier.getADQLName()
.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 returntrue
.table
- Table which contains this column.- Throws:
NullPointerException
- If the given ADQL name is NULL or empty.- Since:
- 2.0
-
-
Method Details
-
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
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
-
getTable
Description copied from interface:DBColumn
Gets the table which contains thisDBColumn
. -
setTable
-
copy
Description copied from interface:DBColumn
Makes a copy of this instance ofDBColumn
.
-