This annotation specifies the mapping between the persistence field or persistence property, and the columns of the database.
Even when @Column is not specified explicitly in the persistence property or persistence field, the persistence property or persistence field is handled as if @Column were specified. In such a case, the default values will be applied in each element value of @Column.
The applicable targets are method and field.
The following table lists the elements of @Column:
Element name | Optional/Required | Element description |
---|---|---|
name | Optional | This element specifies the column name. |
unique | Optional | This element specifies whether or not the property is a unique key. Note that Cosminexus JPA provider does not support this attribute. |
nullable | Optional | This element specifies whether or not a null value can be specified in the database column. Note that Cosminexus JPA provider does not support this attribute. |
insertable | Optional | This element specifies whether or not to include the column specified by @Column in the INSERT statement of the SQL. |
updatable | Optional | This element specifies whether or not to include the column specified by @Column in the UPDATE statement of the SQL. |
columnDefinition | Optional | This element is used to describe the constraints added to the column in the DDL, when the CREATE statement is output. Note that Cosminexus JPA provider does not support this attribute. |
table | Optional | This element specifies the table name that includes the column. |
length | Optional | This element specifies the length of a column. Note that Cosminexus JPA provider does not support this attribute. |
precision | Optional | This element specifies the accuracy of a column. This element is specified when the column is numeric type. Note that Cosminexus JPA provider does not support this attribute. |
scale | Optional | This element specifies the scale of a column. This element is specified when the column is numeric type. Note that Cosminexus JPA provider does not support this attribute. |
The details of attributes that are supported with Cosminexus JPA provider are as follows: