-
@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface MapKeyClass
Specifies the type of the map key for associations of typeMap. The map key can be a basic type, an embeddable class, or an entity. If the map is specified using Java generics, theMapKeyClassannotation and associated type need not be specified; otherwise they must be specified.The
MapKeyClassannotation is used in conjunction withElementCollectionor one of the collection-valued relationship annotations (OneToManyorManyToMany). TheMapKeyannotation is not used whenMapKeyClassis specified and vice versa.Example 1: {@snippet :
- Since:
- 2.0
- See Also:
ElementCollection,OneToMany,ManyToMany
-
-
Element Detail
-
value
Class<?> value
(Required) The type of the map key.
-
-