Annotation Interface Column


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface Column
Specifies the column mapped by the annotated persistent property or field.

If no Column annotation is explicitly specified, the default values apply.

Example 1:

@Column(name = "DESC", nullable = false, length = 512)
public String getDescription() { return description; }

Example 2:

@Column(name = "DESC",
        columnDefinition = "CLOB NOT NULL",
        table = "EMP_DETAIL")
@Lob
public String getDescription() { return description; }

Example 3:

@Column(name = "ORDER_COST", updatable = false, precision = 12, scale = 2)
public BigDecimal getCost() { return cost; }

Portable applications which make use of schema generation should explicitly specify the precision() and scale() of columns of type numeric or decimal.

Since:
1.0