|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) public @interface MapKeyEnumerated
Specifies the enum type for a map key whose basic type is an enumerated type.
The MapKeyEnumerated
annotation can be applied to an
element collection or relationship of type java.util.Map
, in
conjunction with the ElementCollection
, OneToMany
, or
ManyToMany
annotation.
If the enumerated type is not specified or the MapKeyEnumerated
annotation is not used, the enumerated type is assumed to be
ORDINAL
.
Example: public enum ProjectStatus {COMPLETE, DELAYED, CANCELLED, IN_PROGRESS} public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE} @Entity public class Employee { @ManyToMany public Projects<ProjectStatus, Project> getProjects() {...} @OneToMany @MapKeyEnumerated(STRING) public Map<SalaryRate, Employee> getEmployees() {...} ... }
ElementCollection
,
OneToMany
,
ManyToMany
Optional Element Summary | |
---|---|
EnumType |
value
(Optional) The type used in mapping a map key enum type. |
public abstract EnumType value
|
EclipseLink 2.4.2, build 'v20130514-5956486' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |