EnumeratedValue
Target: FIELD
- Implemented Interfaces:
Annotation
Specifies that an annotated field of a Java
enum type is the source of database column values for an plain mapping. The annotated field must be declared final, and must be of type: byte,short, orintfor EnumType.ORDINAL, or- String for EnumType.STRING.
Example:
{@snippet :
enum Status {
OPEN(0), CLOSED(1), CANCELLED(-1);- See Also:
- Enumerated
- EnumType
- Since:
- JPA 3.2
This annotation is a marker annotation (with no attributes).