Package adql.db

Interface DBTable

  • All Superinterfaces:
    java.lang.Iterable<DBColumn>
    All Known Implementing Classes:
    DBTableAlias, DefaultDBTable

    public interface DBTable
    extends java.lang.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()).

    Version:
    1.4 (07/2016)
    Author:
    Grégory Mantelet (CDS;ARI)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DBTable copy​(java.lang.String dbName, java.lang.String adqlName)
      Makes a copy of this instance of DBTable, with the possibility to change the DB and ADQL names.
      java.lang.String getADQLCatalogName()
      Gets the ADQL name of the catalog which contains this table.
      java.lang.String getADQLName()
      Gets the name of this table (without any prefix and double-quotes).
      java.lang.String getADQLSchemaName()
      Gets the ADQL name of the schema which contains this table.
      DBColumn getColumn​(java.lang.String colName, boolean adqlName)
      Gets the definition of the specified column if it exists in this table.
      java.lang.String getDBCatalogName()
      Gets the DB name of the catalog which contains this table.
      java.lang.String getDBName()
      Gets the name of this table in the "database".
      java.lang.String getDBSchemaName()
      Gets the DB name of the schema which contains this table.
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Method Detail

      • getADQLName

        java.lang.String getADQLName()
        Gets the name of this table (without any prefix and double-quotes).
        Returns:
        Its ADQL name.
      • getDBName

        java.lang.String getDBName()
        Gets the name of this table in the "database".
        Returns:
        Its DB name.
      • getADQLSchemaName

        java.lang.String getADQLSchemaName()
        Gets the ADQL name of the schema which contains this table.
        Returns:
        ADQL name of its schema.
      • getDBSchemaName

        java.lang.String getDBSchemaName()
        Gets the DB name of the schema which contains this table.
        Returns:
        DB name of its schema.
      • getADQLCatalogName

        java.lang.String getADQLCatalogName()
        Gets the ADQL name of the catalog which contains this table.
        Returns:
        ADQL name of its catalog.
      • getDBCatalogName

        java.lang.String getDBCatalogName()
        Gets the DB name of the catalog which contains this table.
        Returns:
        DB name of its catalog.
      • getColumn

        DBColumn getColumn​(java.lang.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​(java.lang.String dbName,
                     java.lang.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).
        And 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.
        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", ) => 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. 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. 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.