如何使用enumType:'identity'为Set定义映射?
在 Grails 3.3 中 enumType 成为具有 id 的枚举的强制要求(对于 3.2,它无需任何额外定义即可工作)。
使用枚举字段一切正常,但我不知道如何为枚举集编写映射
class Test {
Set<TestEnum> enums
static mapping {
enums enumType: 'identity' // not works
}
}
enum TestEnum {
final int id
TestEnum(int value){
...
}
}
有任何想法吗?
我知道,我可以使用 enumType:'string'。不适合我