Let enum arrays be saved as integers or strings (#1467)

* Let enums be saved as integers or strings as needed

* Add tests for int and varchar @DbArray enums
This commit is contained in:
Snōwball
2018-08-13 21:26:14 +12:00
committed by Rob Bygrave
parent 0faf9f54ea
commit 9bbe99657a
7 changed files with 106 additions and 13 deletions
@@ -0,0 +1,13 @@
package org.tests.model.array;
import io.ebean.annotation.DbEnumType;
import io.ebean.annotation.DbEnumValue;
public enum IntEnum {
ZERO, ONE, TWO;
@DbEnumValue(storage = DbEnumType.INTEGER)
public int dbValue() {
return 100 + ordinal();
}
}