Class TableMetaData


  • public class TableMetaData
    extends Object
    Database meta data for a table that is part of the model.
    Author:
    harald
    • Constructor Detail

      • TableMetaData

        public TableMetaData​(ModelMetaData modelMetaData,
                             String modelTableName)
        Creates a table meta instance.
        Parameters:
        modelMetaData - the model this table belongs to
        modelTableName - the tablename used in the model
    • Method Detail

      • setupTableFromMetaData

        public void setupTableFromMetaData​(DatabaseMetaData metaData,
                                           String[] schemas,
                                           String schemaPattern,
                                           String tablePattern)
                                    throws SQLException
        Sets up the column from the database meta data result.
        Parameters:
        metaData - the database metadata
        schemas - valid schemas to scan, null if all
        schemaPattern - the schema (null if none, "" if without schema)
        tablePattern - the table pattern
        Throws:
        SQLException - the processing failed
        BackendException - if logical meta data processing error
      • getModelMetaData

        public ModelMetaData getModelMetaData()
        Gets the model this table belongs to.
        Returns:
        the model
      • getModelTableName

        public String getModelTableName()
        Gets the table name used in the model.
        Returns:
        the model's tablename
      • getSchemaName

        public String getSchemaName()
        Gets the database schema name.
        Always in lowercase.
        Returns:
        the schema, null if none
      • getTableName

        public String getTableName()
        Gets the database table name.
        Always in lowercase.
        Returns:
        the table name (without schema)
      • getFullTableName

        public String getFullTableName()
        Gets the database table name with optional schemaname prepended.
        Always in lowercase.
        Returns:
        the full table name
      • getComment

        public String getComment()
        Gets the comment.
        Returns:
        the comment, null if none
      • setComment

        public void setComment​(String comment)
        Sets the comment.
        Parameters:
        comment - the comment, null if none
      • getColumnByName

        public ColumnMetaData getColumnByName​(String columnName)
        Gets a column by its column name.
        Parameters:
        columnName - the column name
        Returns:
        the column, null if no such column
      • validate

        public void validate()
        Validates and postprocesses the table data.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object