-
@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface MapKeyEnumeratedSpecifies the enum type for a map key whose basic type is an enumerated type.The
MapKeyEnumeratedannotation can be applied to an element collection or relationship of typeMap, in conjunction with theElementCollection,OneToMany, orManyToManyannotation. If the enumerated type is not specified or theMapKeyEnumeratedannotation is not used, the enumerated type is assumed to beORDINAL.Example: {@snippet : public enum ProjectStatus {COMPLETE, DELAYED, CANCELLED, IN_PROGRESS} public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}
- Since:
- 2.0
- See Also:
ElementCollection,OneToMany,ManyToMany
-
-
Element Detail
-
value
EnumType value
(Optional) The type used in mapping a map key enum type.- Default:
- jakarta.persistence.EnumType.ORDINAL
-
-