Interface DBTableInfo

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    DBTableInfoImpl, DBTableInfoProxy

    public interface DBTableInfo
    extends java.io.Serializable
    Database info class for a database table. The term table is used in a generic sense meaning any database artifact that can behave in a tabular fashion, and includes views (and in future synonyms, materialised views etc.). All of these will have some things like a name, columns but the different sub-types will differ in some respects e.g. views have SQL that define the view whereas plain tables so not. The properties of this class are a superset of all the properties and not all will be used for any particular sub-type. Note: this class may be refactored in future be better distinguish the different sub-types.
    Author:
    Tim Dudgeon
    • Method Detail

      • getType

        DBTableInfo.Type getType()
        Gets the type of this DBTableInfo instance.
        Returns:
        This DBTableInfo's type.
      • getName

        java.lang.String getName()
        Gets the name of the database artefact represented by this DBTableInfo.
        Returns:
        The database artifact's name.
      • getSchema

        java.lang.String getSchema()
        Gets the database schema name of the associated artefact.
        Returns:
        The database artifact's schema name. This can return null if the database does not use the concept of schemas.
      • schemaPlusTable

        java.lang.String schemaPlusTable()
        Gets the fully qualified name of the underlying database artifact.
        Returns:
        The concatenated form of getName() and getSchema().
      • getSQL

        java.lang.String getSQL()
        Gets the SQL select statement if this is a DBTableInfo.Type.VIEW.
        Returns:
        The SQL select string or null.
      • isReadOnly

        boolean isReadOnly()
        Determines whether this database artifact allows modifications.
        Returns:
        true if this database artifact is readonly and cannot be modified.
      • copy

        DBTableInfo copy()
        Creates a duplicate copy of this DBTableInfo instance.
        Returns:
        A new DBTableInfo instance.
      • getColumn

        DBColInfo getColumn​(java.lang.String name)
        Finds a DBColInfo by its name. This will search through the columns in this DBTableInfo for a column with the required name.
        Parameters:
        name - The name of the column to find.
        Returns:
        The DBColInfo with the required name or null if no such column exists.
      • getColumns

        java.util.List<DBColInfo> getColumns()
        Gets the columns in this DBTableInfo.
        Returns:
        The list of columns.
      • getExportedFKInfo

        java.util.List<DBForeignKeyInfo> getExportedFKInfo()
        Get the foreign keys that involve this table but are defined in a foreign key constraint definition that is defined in another table (though possibly this table). e.g. the keys in this table that are referred to in a foreign key constraint definition somewhere.
        Returns:
        A list of foreign keys
      • getImportedFKInfo

        java.util.List<DBForeignKeyInfo> getImportedFKInfo()
        Get the foreign keys that this table defines. e.g. the primary keys of other tables (or possibly this table) that are referred to in a foreign key constraint definition.
        Returns:
        A list of foreign keys
      • getIndexInfo

        java.util.List<DBIndexInfo> getIndexInfo()
      • getPrimaryKeyColumns

        java.util.List<java.lang.String> getPrimaryKeyColumns()
        Gets the name of the primary key columns.
        Returns:
        The primary key column names. It can return an empty list, but not null.