i am using nhibernate 3.3.1 and fluent-nhibernate 1.3. I try to map the following entity with fluent:
public class Person
{
public int Id { get; set; }
public string Name { get; set; }
public List<Person> Relations { get; set; }
}
As you can see, my person is in relation with some other persons. So I modeled the DB-Table like the following:
| Persons
----+----------------------
PK | Id int
| Name nvarchar(100)
| Relations
----+----------------------
PK | Id int
FK | Person1Id int
FK | Person2Id int
So I want a mapping, where the relations of the person is loaded, no matter if the actual person is referenced as Person1Id or Person2Id.
Is this possible with fluent? And if not, is it possible with a hbn.xml mapping file?
Thanks for help, Koray