Annotation Interface MapKeyColumn


@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface MapKeyColumn
Specifies the mapping for the key column of a map whose map key is a basic type. If the 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
    ...
}
Since:
2.0