Class ColumnMetaData

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getColumnName()
      Gets the columnName of the column.
      java.lang.String getComment()
      Gets the comment.
      java.lang.String getDefaultValue()
      Gets the column's default.
      int getScale()
      Gets the numeric scale.
      int getSize()
      Gets the column's size.
      TableMetaData getTableMetaData()
      Gets the table meta data.
      int getType()
      Gets the column's type.
      java.lang.String getTypeName()
      Gets the backend-specific type columnName.
      boolean isAutoIncrement()
      Returns whether column is auto-incremented by the backend.
      boolean isGenerated()
      Returns whether column is generated by the backend.
      boolean isNullable()
      Returns whether column is nullable.
      boolean matchesSqlType​(SqlType sqlType)
      Checks whether colunm's type matches given SqlType according to the backend.
      void setAutoIncrement​(boolean autoIncrement)
      Sets whether column is auto-incremented by the backend.
      void setColumnName​(java.lang.String columnName)
      Sets the column name.
      void setComment​(java.lang.String comment)
      Sets the comment.
      void setDefaultValue​(java.lang.String defaultValue)
      Sets the default value.
      void setGenerated​(boolean generated)
      Sets whether column is generated by the backend.
      void setNullable​(boolean nullable)
      Sets whether column is nullable.
      void setScale​(int scale)
      Sets the scale.
      void setSize​(int size)
      Sets the size.
      void setType​(int type)
      Sets the type.
      void setTypeName​(java.lang.String typeName)
      Sets the type name.
      void setupColumnFromMetaData​(java.sql.ResultSet resultSet)
      Sets up the column from the database meta data result.
      java.lang.String toString()  
      void validate()
      Validates and postprocesses the column data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ColumnMetaData

        public ColumnMetaData​(TableMetaData tableMetaData)
        Creates column meta data.
        Parameters:
        tableMetaData - the table meta data this column belongs to
    • Method Detail

      • getTableMetaData

        public TableMetaData getTableMetaData()
        Gets the table meta data.
        Returns:
        the table this column belongs to
      • setupColumnFromMetaData

        public void setupColumnFromMetaData​(java.sql.ResultSet resultSet)
                                     throws java.sql.SQLException
        Sets up the column from the database meta data result.
        Parameters:
        resultSet - the column result set
        Throws:
        java.sql.SQLException - the processing the result set failed
      • getColumnName

        public java.lang.String getColumnName()
        Gets the columnName of the column.
        Returns:
        the columnName (always in lowercase)
      • setColumnName

        public void setColumnName​(java.lang.String columnName)
        Sets the column name.
        Parameters:
        columnName - the column name
      • getComment

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

        public void setComment​(java.lang.String comment)
        Sets the comment.
        Parameters:
        comment - the comment
      • getType

        public int getType()
        Gets the column's type.
        Returns:
        the type
        See Also:
        Types
      • setType

        public void setType​(int type)
        Sets the type.
        Parameters:
        type - the type
      • getTypeName

        public java.lang.String getTypeName()
        Gets the backend-specific type columnName.
        Returns:
        the type columnName
      • setTypeName

        public void setTypeName​(java.lang.String typeName)
        Sets the type name.
        Parameters:
        typeName - the type name
      • getSize

        public int getSize()
        Gets the column's size.
        Returns:
        the size
      • setSize

        public void setSize​(int size)
        Sets the size.
        Parameters:
        size - the size
      • getScale

        public int getScale()
        Gets the numeric scale.
        Returns:
        the scale
      • setScale

        public void setScale​(int scale)
        Sets the scale.
        Parameters:
        scale - the scale
      • getDefaultValue

        public java.lang.String getDefaultValue()
        Gets the column's default.
        Returns:
        the default value
      • setDefaultValue

        public void setDefaultValue​(java.lang.String defaultValue)
        Sets the default value.
        Parameters:
        defaultValue - the default value
      • isNullable

        public boolean isNullable()
        Returns whether column is nullable.
        Returns:
        true if nullable
      • setNullable

        public void setNullable​(boolean nullable)
        Sets whether column is nullable.
        Parameters:
        nullable - true if nullable
      • isGenerated

        public boolean isGenerated()
        Returns whether column is generated by the backend.
        Returns:
        true if generated
      • setGenerated

        public void setGenerated​(boolean generated)
        Sets whether column is generated by the backend.
        Parameters:
        generated - if generated
      • isAutoIncrement

        public boolean isAutoIncrement()
        Returns whether column is auto-incremented by the backend.
        Returns:
        true if autoincremented
      • setAutoIncrement

        public void setAutoIncrement​(boolean autoIncrement)
        Sets whether column is auto-incremented by the backend.
        Parameters:
        autoIncrement - true if autoincremented
      • matchesSqlType

        public boolean matchesSqlType​(SqlType sqlType)
        Checks whether colunm's type matches given SqlType according to the backend.
        Parameters:
        sqlType - the sqltype
        Returns:
        true if matches
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • validate

        public void validate()
        Validates and postprocesses the column data.