name element is not specified,
it defaults to the concatenation of the following: the name of
the referencing relationship field or property; "_";
"KEY".
Example:
@Entity
public class Item {
@Id
int id;
...
@ElementCollection
@MapKeyColumn(name = "IMAGE_NAME")
@Column(name = "IMAGE_FILENAME")
@CollectionTable(name = "IMAGE_MAPPING")
Map<String, String> images; // map from image name to filename
...
}
| Modifier and Type | Method and Description |
|---|---|
| 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 String | |
| public boolean | |
| public boolean | updatable()
(Optional) Whether the column is included in SQL UPDATE statements generated by the persistence provider. |
| 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. | |
| 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 map key column. The table in which it is found depends upon the context.
Defaults to the concatenation of the following: the name of
the referencing relationship field or property; " | |
| 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
| |
| 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 | |
| table | back to summary |
|---|---|
| public String table() (Optional) The name of the table that contains the column. Defaults: If the map key is for an element collection,
the name of the collection table for the map value. If the
map key is for a | |
| 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. | |