Is there a simple way to store a set/list of Enum items using JPA (with Hibernate)?
There could be no duplicates in the list.
I currently try:
public EnumSet<MediaRole.MediaRoleEnum> mediaRoles;
But this returns a null pointer when accessing the field.
Just use:
depending on your needs. Check Which Java Type do you use for JPA collections and why?
In the mapping file:
If you use annotations, just use the equivalent one: