如何将 EnumSet 存储在数据库中(使用 Hibernate)?
@Entity
public class A
{
public static enum SOME_ENUM { A, B, C };
private EnumSet<SOME_ENUM> myEnumSet = EnumSet.of(SOME_ENUM.A, SOME_ENUM.B);
...
...
}
如果我尝试坚持上述内容,我当然会例外。我想使用@CollectionOfElements,但它已被弃用。@CollectionOfElements 有什么替代品吗?
有没有办法在不写 UserType 的情况下将 EnumSet 存储在单个列中?
谢谢!