Is it possible to use a many-to-many relationship to the same class, without having to duplicate the relationships in the linktable?
E.g.:
Code:
<class name="User" table="users">
<id name="Id" column="id" type="long">
<generator class="sequence">
<param name="sequence">users_id_seq</param>
</generator>
</id>
<property name="Username" column="username" type="string" />
<bag name="Friends" table="friends">
<key column="user1" />
<many-to-many column="user2" class="User" />
</bag>
</class>
This works only one way, because NHibernate only selects the users where the current user's id is in the user1 column, not when its in user2.