@Target(value=FIELD) @Retention(value=RUNTIME) public @interface EnumValue
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
DbEnumValue 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.
Copyright © 2019. All rights reserved.