Enum

Enumタイプの場合は、JPA標準@Enumeratedを使用するか、Ebean固有の@DbEnumValueを使用できます。

 

例:Enum名値を使用したJPA標準
@Enumerated(EnumType.STRING)
Status status;

 

例:Ebean @DbEnumValueの使用
public enum Status {
  NEW("N"),
  ACTIVE("A"),
  INACTIVE("I");

  String dbValue;
  Status(String dbValue) {
    this.dbValue = dbValue;
  }

  // annotate a method that returns the value
  // in the DB that the enum element maps to
  @DbEnumValue
  public String getValue() {
    return dbValue;
  }
}