I´m sorry if I haven´t investigated enough but I´m not quite an expert in hibernate and I´m tired of looking for something that won´t really solve my specific problem. What I mean is that I am a bit short of time. I have a User class that represents every single user of the system.
Every User has a Set of Roles (which is an enum type) that indicates which resources the user can and cannot acces. Nothing complicated. I am using Hibernate to map this classes but I am having problems with this last part.
It doesn´t bother me at all how the Roles, say, field(which, I repeat, is an enum) is mapped in the DB (could be an int or a String) but it must definetly be an extra table, I guess, which has the fk of the user and the field which corresponds the role to the user, as one user has many roles assigned to it. I am using JPA annotations. I do not believe any sample code is necesary because this is that simple: The user class has a set of enum types which must be mapped with jpa Annotations.
I´m sorry for the bad english but it´s not my native language as you can see. Thanks a lot.
elSifa 0 Newbie Poster
quuba 81 Posting Pro
elSifa 0 Newbie Poster
elSifa 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
elSifa 0 Newbie Poster
msi_333 0 Newbie Poster
quuba 81 Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.