Class Column

  • All Implemented Interfaces:
    Serializable

    public class Column
    extends Object
    implements Serializable
    Represents a column in the entry schema of a log in the log management facility, aka. log manager

    Columns may not contain an underscore _. Otherwise they may be legal SQL identifiers, which may depend on the actual DBMS. So it's a good idea to stick with the Latin alphabet and digits. Also the names id and refId may not be used because these identifiers are used internally.

    Author:
    Patrick Schmidt
    See Also:
    Serialized Form
    • Field Detail

      • ID_COLUMN

        public static final Column ID_COLUMN
        The ID column added to every log to identify the log entries.
      • REF_COLUMN

        public static final Column REF_COLUMN
        The referenced ID column added to every subschema of a log to identify parent log entry.
    • Constructor Detail

      • Column

        public Column​(String name,
                      DataType dataType)
        Constructs a new Column with the specified data type.

        There are separate constructors for DataType.STRING and DataType.COMPLEX. This constructor cannot be used for these.

        Parameters:
        name - the name of the column
        dataType - the data type of the column
      • Column

        public Column​(String name,
                      int sizeHint)
        Constructs a string column with the specified size.
        Parameters:
        name - the name of the column
        sizeHint - the required number of characters
      • Column

        public Column​(String name,
                      Schema subSchema)
        Constructs a complex column with the specified subschema.
        Parameters:
        name - the name of the column
        subSchema - the subschema of the column
    • Method Detail

      • getName

        public String getName()
        Returns the name of this column.
        Returns:
        the name of this column
      • getDataType

        public DataType getDataType()
        Returns the data type of this column.
        Returns:
        the data type of this column
      • getSubSchema

        public Schema getSubSchema()
        Returns the subschema of this column or null if the data type of this column is something else than DataType.COMPLEX.
        Returns:
        the subschema of this column or null
      • getSizeHint

        public int getSizeHint()
        Returns the size hint for this column. Currently this value is only used for DataType.STRING and indicates the required capacity when creating the required tables of a log.
        Returns:
        the size hint of this column
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object