Hi there,
I'm trying to persist a Set of enums using JPA annotations only. Unfortunately I either get an error about the enum class not being mapped (if I annotate the set with @ManyToMany) or about Hibernate not being able to determine a type for java.util.Set (if I omit the @ManyToMany annotation). I have the feeling that Hibernate (at least 3.3.1.GA) is not capable of persisting a set of enums, is that right?
Below is a sample of what I'm trying to do.
Uli
Code:
@Entity
public class ProjectUserRole extends BaseEntity
{
...
@ManyToMany
@Enumerated(EnumType.ORDINAL)
public Set<Role> getRoles()
{
return roles;
}
public void setRoles(Set<Role> roles)
{
this.roles = roles;
}
}
With Role being a Java enum.