NHibernate has support for this kind of the DB design. The mapping in this case will use many-to-many
element - without any explicit mapping of the pairing entity/table.
Here is an adjusted snippet coming from the documentation: 6.8. Bidirectional Associations
<class name="User">
<id name="Id" column="UserID"/>
...
<bag name="Permissions" table="UserPermissions" lazy="true">
<key column="UserID"/>
<many-to-many class="Permission" column="PermissionID"/>
</bag>
</class>
<class name="Permission">
<id name="Id" column="PermissionID"/>
...
<!-- inverse end -->
<bag name="Users" table="UserPermissions" inverse="true" lazy="true">
<key column="PermissionID"/>
<many-to-many class="User" column="UserID"/>
</bag>
</class>