How to save EnumSet in a database (using 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);
...
...
}
If I try to keep the above, I get an exception, of course. I wanted to use @CollectionOfElements, but it is deprecated. Is there an alternative to @CollectionOfElements?
Is there a way to save EnumSet in a single column without a UserType entry?
Thank!
source
share