Disclaimer: Not aware of a well-defined best practice, and haven't tried/tested this:
How about having a child implementation/inheritor for each parent? With interfaces, might look like this:
mapping might be something like this
Code:
<class name="INote" ... >
<id name="id" ...>...</id>
<discriminator column="parent_type"/>
<property name="data" />
<subclass name="type1note" discriminator-value="type1" ...>
<many-to-one name="Parent" class="type1" column="parent_id" />
</subclass>
<subclass name="type2note" discriminator-value="type2" ...>
<many-to-one name="Parent" class="type2" column="parent_id" />
</subclass>
...
</class>
Parent mapping would be
Code:
<class name="Type1">
<id name="id"...>...</id>
<property name="data"/>
<[collection] name="Notes" inverse="true"...>
<key column="parent_id" />
<one-to-many class="type1note" />
</[collection]>
</class>
That should do you very nicely, retaining your underlying table structure.
Again, not tried/tested, so YMMGV. Abstract note base might be better, too, for reuse of things that won't change.
Good luck!
-Marc