Hi,
I have a class (RolePermissionSet) with a member like:
private IDictionary<Role, HashSet<Permission>> _rolePermissions = new
Dictionary<Role, HashSet<Permission>>();
that I'm not too sure how to map. To make things even more
complicated, the class that it belongs to is a component of another
mapped class.
What I have is:
<component name="ProcessSetRolePermissions" access="field.camelcase-
underscore"
class="OzoneHR.Domain.Core.Authorisation.RolePermissionSet">
<map name="RolePermissions"
access="field.camelcase-underscore"
table="PermissionInRoleInProcessSet"
cascade="all-delete-orphan"
lazy="false">
<key column="ProcessSetId" />
<index-many-to-many
class="OzoneHR.Domain.Core.Authorisation.Role" column="RoleId" />
<many-to-many
class="OzoneHR.Domain.Core.Authorisation.Permission"
column="PermissionId"/>
</map>
</component>
My table structure in the db is along the lines of:
PermissionInRoleInProcessSet
- ProcessSetId int
- RoleId int
- PermissionId int
all of which are foreign keys into other tables which map to the
entities concerned.
Is this something nHibernate can deal with or do I need to structure
my classes differently somehow?
The error I'm currently getting when trying to persist the root entity
is:
NHibernate.PropertyAccessException : Exception occurred getter of
OzoneHR.Domain.Core.Authorisation.Permission.Id
----> System.Reflection.TargetException : Object does not match
target type.
Thanks very much,
Matt
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---