Interface ColumnProperty

    • Method Detail

      • getColumnName

        String getColumnName()
        Returns:
        the column name
      • getColumnType

        int getColumnType()
        Returns:
        the data type of the underlying column, usually the same as Property.getType() but can differ when the database system does not have native support for the given data type, such as boolean
      • toColumnValue

        Object toColumnValue​(Object value)
        Translates the given value into a sql value, usually this is not required but for certain types this may be necessary, such as boolean values represented by a non-boolean data type in the underlying database
        Parameters:
        value - the value to translate
        Returns:
        the sql value used to represent the given value
      • fromColumnValue

        Object fromColumnValue​(Object value)
        Parameters:
        value - the SQL value Object to translate from
        Returns:
        the value of SQL value
      • getPrimaryKeyIndex

        int getPrimaryKeyIndex()
        Returns:
        this propertys zero based index in the primary key, -1 if this property is not part of a primary key
      • isPrimaryKeyProperty

        boolean isPrimaryKeyProperty()
        Returns:
        true if this property is part of a primary key
      • isGroupingColumn

        boolean isGroupingColumn()
        Returns:
        true if this column is a group by column
      • isAggregateColumn

        boolean isAggregateColumn()
        Returns:
        true if this is an aggregate column
      • isSelectable

        boolean isSelectable()
        Returns:
        true if this property should be included in select queries
      • isInsertable

        boolean isInsertable()
        Specifies whether or not this property is insertable
        Returns:
        true if this property is insertable
      • isUpdatable

        boolean isUpdatable()
        Indicates whether or not this column is updatable
        Returns:
        true if this column is updatable
      • isReadOnly

        boolean isReadOnly()
        Returns:
        true if this property is neither insertable nor updatable.
      • isDenormalized

        boolean isDenormalized()
        Returns:
        true if this column is a denormalized column, one should which receives a value from a column in a table referenced via a foreign key
      • isForeignKeyProperty

        boolean isForeignKeyProperty()
        Returns:
        true if this property is part of a ForeignKeyProperty
      • columnHasDefaultValue

        boolean columnHasDefaultValue()
        Returns:
        true if the underlying column has a default value
      • fetchValue

        <T> T fetchValue​(ResultSet resultSet,
                         int index)
                  throws SQLException
        Fetches a value for this property from a ResultSet
        Type Parameters:
        T - the value type
        Parameters:
        resultSet - the ResultSet
        index - the index of the column to fetch
        Returns:
        a single value fetched from the given ResultSet
        Throws:
        SQLException - in case of an exception
      • getResultPacker

        <T> ResultPacker<T> getResultPacker()
        Type Parameters:
        T - the result type
        Returns:
        a ResultPacker responsible for packing this property