3.2.2.2. Declaring column attributes
The column(s) used for a property mapping can be defined using the
@Column annotation. Use it to override default values (see the EJB3 specification for more information on the defaults). You can use this annotation at the property level for properties that are:
- not annotated at all
- annotated with
@Basic - annotated with
@Version - annotated with
@Lob - annotated with
@Temporal - annotated with
@org.hibernate.annotations.CollectionOfElements(for Hibernate only)
The
name property is mapped to the flight_name column, which is not nullable, has a length of 50 and is not updatable (making the property immutable).
This annotation can be applied to regular properties as well as
@Id or @Version properties.
| name (optional): the column name (default to the property name)
|
| unique (optional): set a unique constraint on this column or not (default false)
|
| nullable (optional): set the column as nullable (default true).
|
| insertable (optional): whether or not the column will be part of the insert statement (default true)
|
| updatable (optional): whether or not the column will be part of the update statement (default true)
|
| columnDefinition (optional): override the sql DDL fragment for this particular column (non portable)
|
| table (optional): define the targeted table (default primary table)
|
| (optional): column length (default 255)
|
| (optional): column decimal precision (default 0)
|
| (optional): column decimal scale if useful (default 0)
|







