Annotation Interface Column


@Target(FIELD) @Retention(RUNTIME) public @interface Column
Indicates a database column.

The annotated field must be a member of an Entity annotated class.

 @Entity
 public class Employee {

     @Column(name = "EMPLOYEE_NAME")
     String employeeName;

     @Column(name = "SALARY")
     BigDecimal salary;

     ...
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
     
    The name of the column.
    boolean
     
    boolean
     
  • Element Details

    • name

      String name
      The name of the column.

      If not specified, the name is resolved by Entity.naming().

      Returns:
      the name
      Default:
      ""
    • insertable

      boolean insertable
      Returns:
      whether the column should be included in SQL INSERT statements.
      Default:
      true
    • updatable

      boolean updatable
      Returns:
      whether the column should be included in SQL UPDATE statements.
      Default:
      true
    • quote

      boolean quote
      Returns:
      whether the column name should be enclosed by quotation marks in SQL statements.
      Default:
      false