Many to Many on a base type
Posted: Tue 13 Nov 2012 06:35
Hi,
I am testing the nhibernate trail version.
I am planning a system with 3 different type of users.
AdvertizerUser
PublisherUser
EmployeeUser
they are all inheriting from BaseUser(abstract, table per concrete type)
I want BaseUser to have Many to Many relations with Role table so each user has X amount of roles.
So AdvertizerUser,EmployeeUser,PublisherUser will have Roles property inside.
When I do manual development of fluent nhibernate, this is no-brainer.
I just set the property
public virtual List<Role> Roles { get; set; }
Map(x => x.Roles).CustomType(typeof(UserRoleCustomType)).Column("roles");
and it will be divided in to the three *User tables.
So, what is the way to create many to many relation in base type for all children.
Thanks
I am testing the nhibernate trail version.
I am planning a system with 3 different type of users.
AdvertizerUser
PublisherUser
EmployeeUser
they are all inheriting from BaseUser(abstract, table per concrete type)
I want BaseUser to have Many to Many relations with Role table so each user has X amount of roles.
So AdvertizerUser,EmployeeUser,PublisherUser will have Roles property inside.
When I do manual development of fluent nhibernate, this is no-brainer.
I just set the property
public virtual List<Role> Roles { get; set; }
Map(x => x.Roles).CustomType(typeof(UserRoleCustomType)).Column("roles");
and it will be divided in to the three *User tables.
So, what is the way to create many to many relation in base type for all children.
Thanks