@Enumerated
Mapping for an Enum property that uses either the ordinal
value
or the name
value of the enum.
Note that there is some risk in using ORDINAL values in that the value is implied by the order of the values in the enum. That is, if a value is added into the middle of an Enum then that is a subtle change to the ordinal values. In this sense I personally don't recommend using ordinal values.
Example: Enum ORDINAL values
// defaults to using ORDINAL value
@Enumerated
Status status;
Example: Enum NAME values
@Enumerated(EnumType.STRING)
Status status;
Alternative: Ebean @DbEnumValue
An alternative to JPA standard @Enumerated
is Ebean specific
@DbEnumValue