Package adql.db

Class DefaultDBColumn

java.lang.Object
adql.db.DefaultDBColumn
All Implemented Interfaces:
DBColumn

public class DefaultDBColumn extends Object implements DBColumn
Default implementation of DBColumn.
Version:
1.4 (08/2015)
Author:
Grégory Mantelet (CDS;ARI)
  • Field Details

    • dbName

      protected 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 String adqlName
      Name that this column must have in ADQL queries.
  • Constructor Details

    • DefaultDBColumn

      public DefaultDBColumn(String dbName, DBTable table)
      Builds a default DBColumn 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 to DefaultDBTable, if a whole column reference is given, no split will be done.
      table - DB table which contains this column.
      See Also:
    • DefaultDBColumn

      public DefaultDBColumn(String dbName, DBType type, DBTable table)
      Builds a default DBColumn 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 to DefaultDBTable, 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

      public DefaultDBColumn(String dbName, String adqlName, DBTable table)
      Builds a default DBColumn with the given DB name, DB table and ADQL name.
      Parameters:
      dbName - Database column name. Only the column name is expected. Contrary to DefaultDBTable, 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 to DefaultDBTable, if a whole column reference is given, no split will be done.
      table - DB table which contains this column.
      See Also:
    • DefaultDBColumn

      public DefaultDBColumn(String dbName, String adqlName, DBType type, DBTable table)
      Builds a default DBColumn with the given DB name, DB table and ADQL name.
      Parameters:
      dbName - Database column name. Only the column name is expected. Contrary to DefaultDBTable, 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 to DefaultDBTable, 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 Details

    • getADQLName

      public final String getADQLName()
      Description copied from interface: DBColumn
      Gets the name of this column (without any prefix and double-quotes).
      Specified by:
      getADQLName in interface DBColumn
      Returns:
      Its ADQL name.
    • setADQLName

      public final void setADQLName(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 interface DBColumn
      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 String getDBName()
      Description copied from interface: DBColumn
      Gets the name of this column in the "database".
      Specified by:
      getDBName in interface DBColumn
      Returns:
      Its DB name.
    • getTable

      public final DBTable getTable()
      Description copied from interface: DBColumn
      Gets the table which contains this DBColumn.
      Specified by:
      getTable in interface DBColumn
      Returns:
      Its table or null if no table is specified.
    • setTable

      public final void setTable(DBTable table)
    • copy

      public DBColumn copy(String dbName, String adqlName, DBTable dbTable)
      Description copied from interface: DBColumn
      Makes a copy of this instance of DBColumn.
      Specified by:
      copy in interface DBColumn
      Parameters:
      dbName - Its new DB name.
      adqlName - Its new ADQL name.
      dbTable - Its new table.
      Returns:
      A modified copy of this DBColumn.