Annotation Interface Column


@Retention(RUNTIME) @Target({METHOD,FIELD}) public @interface Column
Optional annotation defining a column mapping for a property on the class. This annotation can appear on the class field, getter or setter.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Deprecated.
    boolean
    Indicates that this column has a default value in the database.
    Name of the column mapped to the property.
    boolean
    Indicates that this column is a primary key.
    boolean
    Indicates this column is read-only.
  • Element Details

    • name

      String name
      Name of the column mapped to the property. Used when the property cannot be auto-mapped to a table column.

      It's only required if Persism cannot discover the column/property mapping on its own.

      Returns:
      Name of the column mapped to the property.
      Default:
      ""
    • autoIncrement

      @Deprecated boolean autoIncrement
      Deprecated.
      Indicates if the column is an auto increment field. This will tell Persism to exclude this column in insert statements and to update the object with this column value after the insert.

      It's only required if Persism cannot detect this column attribute on its own. The only case for this seems to be Oracle before version 12. To maybe be deprecated later on.

      Returns:
      true if this column is autoIncrement.
      Default:
      false
    • primary

      boolean primary
      Indicates that this column is a primary key.

      It's only required if Persism cannot detect this column attribute on its own.

      Returns:
      true if this column is a primary key.
      Default:
      false
    • hasDefault

      boolean hasDefault
      Indicates that this column has a default value in the database. This tells Persism that if the data object did not specify a value then Persism will update the data object with the default after an insert.

      It's only required if Persism cannot detect this column attribute on its own.

      Returns:
      true if this column has a default value in the database.
      Default:
      false
    • readOnly

      boolean readOnly
      Indicates this column is read-only. It will be included in the SELECT to be initialized but will not be included in INSERT or UPDATE statements.
      Returns:
      true if this column is identified by the annotation as read-only.
      Default:
      false