I can't seem to find support for this.
I'm working with a system that would have over 20 many-to-many relationships, so I'm trying to consolidate a few...
For instance, I have a Person object. It has 5 many-to-many relationship sets to other entities and data types. So I would like to have one mapping table for all of the many-to-many relationships associated with the Person.
So my PersonDetail mapping table has columns like PersonId, ReferenceId, Category.
So for example, I have a PublishTo set that I want to map. And it's Category will be 'Publish'. How do I specify that? I can specify my key and many-to-many relationship no problem like:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="..." namespace="...">
<class name="Person" table="People">
<id name="Identifier" type="Int32" column="PersonId" unsaved-value="0">
<generator class="native"/>
</id>
<property name="FirstName" type="String" length="20"/>
<property name="LastName" type="String" length="20"/>
<set name="PublishTo" table="PeopleDetail" lazy="true">
<key column="PersonId"/>
<many-to-many class="Publish" column="ReferenceId"/>
</set>
</class>
</hibernate-mapping>
but I can't specify another column to populate. I tried using where="Category='Publish'" in my set definition, and that works for retreiving the data, but doesn't work when I try to insert or update. It just leaves the Category field null.
Anyone know a solution for this?