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.
| Modifier and Type | Method and Description |
|---|---|
| public CheckConstraint[] | |
| public String | |
| public String | |
| public boolean | insertable()
(Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider. |
| public int | |
| public String | |
| public boolean | |
| public String | |
| public int | precision()
(Optional) The precision for a column of SQL type |
| public int | scale()
(Optional) The scale for a column of SQL type |
| public int | secondPrecision()
(Optional) The number of decimal digits to use for storing
fractional seconds in a SQL |
| public String | |
| public boolean | |
| public boolean | updatable()
(Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider. |
| check | back to summary |
|---|---|
| public CheckConstraint[] check() (Optional) Check constraints to be applied to the column. These are only used if table generation is in effect.
| |
| columnDefinition | back to summary |
|---|---|
| public String columnDefinition() (Optional) The SQL fragment that is used when generating the DDL for the column. Defaults to the generated SQL to create a column of the inferred type. The specified DDL must be written in the native SQL dialect of the target database, and is not portable across databases. | |
| comment | back to summary |
|---|---|
| public String comment() (Optional) A comment to be applied to the column. This is only used if table generation is in effect.
| |
| insertable | back to summary |
|---|---|
| public boolean insertable() (Optional) Whether the column is included in SQL INSERT statements generated by the persistence provider. | |
| length | back to summary |
|---|---|
| public int length() (Optional) The column length.
Applies only to columns whose type is parameterized by length,
for example, | |
| name | back to summary |
|---|---|
| public String name() (Optional) The name of the column. Defaults to the property or field name. | |
| nullable | back to summary |
|---|---|
| public boolean nullable() (Optional) Whether the database column is nullable. | |
| options | back to summary |
|---|---|
| public String options() (Optional) A SQL fragment appended to the generated DDL
which declares this column. May not be used in conjunction
with The specified DDL must be written in the native SQL dialect of the target database, and is not portable across databases.
| |
| precision | back to summary |
|---|---|
| public int precision() (Optional) The precision for a column of SQL type Applies only to columns of exact numeric type.
The default value | |
| scale | back to summary |
|---|---|
| public int scale() (Optional) The scale for a column of SQL type Applies only to columns of exact numeric type.
The default value | |
| secondPrecision | back to summary |
|---|---|
| public int secondPrecision() (Optional) The number of decimal digits to use for storing
fractional seconds in a SQL Applies only to columns of time or timestamp type.
The default value
| |
| table | back to summary |
|---|---|
| public String table() (Optional) The name of the table that contains the column. If absent the column is assumed to be in the primary table. | |
| unique | back to summary |
|---|---|
| public boolean unique() (Optional) Whether the column is a unique key. This is a
shortcut for the | |
| updatable | back to summary |
|---|---|
| public boolean updatable() (Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider. | |