Nhibernate foreign key to foreign key collection mapping?

I think the problem is that it's not really a one to many. In reality, that is an expression of a many-to-many relationship.

I think the problem is that it's not really a one to many. In reality, that is an expression of a many-to-many relationship. I know this doesn't sound like what you wanted to hear (as you said you didn't create a Role entity) but you may want to consider doing so for your own sake.Is there a "Role" table that would act as the cross-reference between these two tables you presented?

If not, you should make one and that will help to resolve the problem. If so, you may want to consider the relationship between employees and roles as being direct, and employees and SecuredPages as being indirect (through roles, which it is). EDIT: Can you tell us why you didn't create a "Role" entity?

That may help to clarify for us.

Thanks for your reply, There is no Role table because I just have 3 roles (Admin,Secretary,Advisor). I defined them as Enums. I know that, this isnt the way for roles, staff and securedpages.

I just want to have a custom Collection thing inside my Staff Entity. Or I could get that collection manually on Staff.Login() method?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions