mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user