|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Target(value=FIELD) @Retention(value=RUNTIME) public @interface EnumValue
Enables you to specify a value to use to persist for an enum value.
public enum Status { @EnumValue("N") NEW, @EnumValue("A") ACTIVE, @EnumValue("I") INACTIVE, }
This is an alternative to using the JPA standard approach or Ebean's
EnumMapping
annotation.
Note that if all the EnumValue values are parsable as Integers then Ebean will persist and fetch them as integers - otherwise they will be persisted and fetched as strings.
Required Element Summary | |
---|---|
String |
value
Specify the value to persist for a specific enum value. |
Element Detail |
---|
public abstract String value
If all the values are parsable as Integers then Ebean will persist and fetch them as integers rather than strings.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |