I have a Group. That group can contain groups and this needs to be mapped with NHibernate. I have done this before but this time I got an existing database that does not really store the data like I would like it too.
The database looks like this:
Groups
Id
Groups_Link
ParentId ChildId
I have no clue about how to map this?
Edit:
Seems like it's not that easy. One group can exist as a child to more than one group. So it should be an many-to-many association with itself I guess. Well, have yet to figure out how to do this. Any hints would be really appreciated!
Edit:
I thought views could help me solve the problem but there seems to be some restrictions on insert, update and delete with views that makes it difficult.