Interface ColumnDefinition<T>

Type Parameters:
T - the underlying type
All Superinterfaces:
AttributeDefinition<T>
All Known Subinterfaces:
AuditColumnDefinition<T>

public interface ColumnDefinition<T> extends AttributeDefinition<T>
Specifies a attribute definition based on a table column
  • Method Details

    • attribute

      Column<T> attribute()
      Description copied from interface: AttributeDefinition
      The Attribute this definition is based on, should be unique within an Entity. By default, the Attribute.name() serves as column name for database columns.
      Specified by:
      attribute in interface AttributeDefinition<T>
      Returns:
      the attribute this definition is based on
    • name

      String name()
      Note: returns null when used in a remote connection context.
      Returns:
      the column name
    • expression

      String expression()
      Note: returns null when used in a remote connection context.
      Returns:
      the column expression to use when selecting or the column name if no expression has been set
    • type

      int type()
      Returns:
      the sql data type of the underlying column (Types.
    • converter

      <C> Column.Converter<C,T> converter()
      Note: returns null when used in a remote connection context.
      Type Parameters:
      C - the colum value type
      Returns:
      the Column.Converter for this column.
    • primaryKeyIndex

      int primaryKeyIndex()
      Returns:
      this columns zero based index in the primary key, -1 if this column is not part of a primary key
    • primaryKey

      boolean primaryKey()
      Returns:
      true if this column is part of a primary key
    • groupBy

      boolean groupBy()
      Returns:
      true if this column should be grouped by
    • aggregate

      boolean aggregate()
      Returns:
      true if this column is based on an aggregate function
    • selectable

      boolean selectable()
      Returns:
      true if this column should be included in select queries
    • lazy

      boolean lazy()
      Returns:
      true if this column should not be selected by default
    • insertable

      boolean insertable()
      Specifies whether this column is insertable
      Returns:
      true if this column is insertable
    • updatable

      boolean updatable()
      Indicates whether this column is updatable
      Returns:
      true if this column is updatable
    • readOnly

      boolean readOnly()
      Returns:
      true if this column is neither insertable nor updatable.
    • columnHasDefaultValue

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

      boolean searchable()
      Returns:
      true if this column should be included when searching by string
    • get

      T get(ResultSet resultSet, int index) throws SQLException
      Fetches a value for this column from a ResultSet
      Parameters:
      resultSet - the ResultSet
      index - this columns index in the result
      Returns:
      a single value fetched from the given ResultSet
      Throws:
      SQLException - in case of an exception