Maybe you could map that as a many-to-many between the user table and
the role table. I think the UserRole table wouldn't end up in your
domain.
I don't think it matters in this case that a user can only have one
role. Anyhow, that's how I would hack it :)


On Mar 8, 8:23 pm, mysterd429 <[email protected]> wrote:
> Hi all,
>
> I'm not sure how to go about solving this using NHibernate.  I have an
> enumeration, Role, that corresponds to a lookup table in the database,
> ROLE.  There's a User class that maps to the USER table.  There's also
> a table, USER_ROLE, that has a composite primary key of USER_ID and
> ROLE_ID.  I'd like for the User class to have an ISet<Role>, which
> would indicate which roles they have.
>
> Obviously, I could create a new class, UserRole, but I think the more
> OO way would be to use the ISet.  Unfortunately, I'm not really sure
> how to get started, since the other side of the "many" is basically an
> integer and not a class.
>
> Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to