Package adql.db

Interface DBTable

All Superinterfaces:
Iterable<DBColumn>
All Known Implementing Classes:
DBTableAlias, DefaultDBTable

public interface DBTable extends Iterable<DBColumn>
Definition of a valid target table.

This table can be used in an ADQL query with its ADQL name (getADQLName()) and corresponds to a real table in the "database" with its DB name (getDBName()).

  • Method Details

    • getADQLName

      String getADQLName()
      Gets the name of this table in ADQL queries.

      Notes: The returned ADQL name is:

      • non-empty/NULL
      • non-delimited (i.e. not between double quotes),
      • non-prefixed (i.e. no schema/catalog name)
      • and in the same case as provided at initialization (even if not case sensitive).
      Returns:
      Its ADQL name.
    • isCaseSensitive

      boolean isCaseSensitive()
      Tell whether the table name used in ADQL queries must be delimited (i.e. surrounded by "). In such case, it will be case sensitive.
      Returns:
      true if the ADQL table name is case sensitive, false otherwise.
      Since:
      2.0
    • getDBName

      String getDBName()
      Gets the name of this table in the "database" (e.g. as it should be used in SQL queries).

      Notes The returned DB name is:

      • non-empty/NULL
      • non-delimited (i.e. not between double quotes),
      • non-prefixed (i.e. no schema/catalog name)
      • and in the EXACT case as it MUST be used.
      Returns:
      Its DB name.
    • getADQLSchemaName

      String getADQLSchemaName()
      Gets the ADQL name of the schema which contains this table.

      Warning! Same rules as getADQLName().

      Returns:
      ADQL name of its schema.
    • getDBSchemaName

      String getDBSchemaName()
      Gets the DB name of the schema which contains this table.

      Warning! Same rules as getDBName().

      Returns:
      DB name of its schema.
    • getADQLCatalogName

      String getADQLCatalogName()
      Gets the ADQL name of the catalog which contains this table.

      Warning! Same rules as getADQLName().

      Returns:
      ADQL name of its catalog.
    • getDBCatalogName

      String getDBCatalogName()
      Gets the DB name of the catalog which contains this table.

      Warning! Same rules as getDBName().

      Returns:
      DB name of its catalog.
    • getColumn

      DBColumn getColumn(String colName, boolean adqlName)
      Gets the definition of the specified column if it exists in this table.
      Parameters:
      colName - Name of the column (may be the ADQL or DB name depending of the second parameter).
      adqlName - 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

      DBTable copy(String dbName, String adqlName)
      Makes a copy of this instance of DBTable, 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"
      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.