Look into 'ternary associations' and the index-many-to-many element in the manual found at http://nhforge.org.
Havent' used this myself but I guess the Company POCO will have a 'map'-property of type IDictionary<Role, PermissionSet>. I guess Role and Company are entities, but I am unsure about PermissionSet, it feels like a value object (maybe a set of components)? Well sorry I haven't got a 'cook book' answer for you, but haven't used something like the above yet. Maybe somebody will tell me this isn't possible, but trying it will only teach you NH. Good luck:-M >-----Original Message----- >From: [email protected] [mailto:[email protected]] On Behalf >Of Ralph Balck >Sent: Thursday, September 17, 2009 7:58 PM >To: nhusers >Subject: [nhusers] How to map three related tables? > > >I have a three tables, (Role, Permission, Company) that in my mind >seem to form a many-to-many-to-many relationship. Each company has >their own set of permissions per role. My thought was that i need a >table that has 3 ID columns, RoleID, PermissionID, and CompanyID, but >i dont have a clue how to map that in nhibernate. > >Is there a many-to-many-to-many map? > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
