I have this simple scenario, but I can't get my head around it:
Table Group (id, description)
Table SubGroup (id, description)
Table GroupSubGroup (id, group_id, subgroup_id)
So, Groups can have several SubGroups, and SubGroups can have several Groups.
The users need to add and delete both ways.
Mapping looks like this:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Foo.Framework.Domain" assembly="Foo.Framework" schema="FOO">
<class name="Group" table="GROUP" lazy="false">
<id name="Code" column="CODE" type="string">
<generator class="assigned"/>
</id>
<property name="Description" column="DES" type="string" />
<bag name="SubGroups" lazy="false" table="GROUPSUBGROUP" cascade="all">
<key column="GROUP_CODE"/>
<many-to-many column="SUBGROUP_CODE" class="Foo.Framework.Domain.Subgroup, Foo.Framework"/>
</bag>
</class>
</hibernate-mapping>
When Hibernate tries to (re)insert entries for the cross-table, I do need an Id provided by an Oracle-sequence...
What syntax am I needing here?
Thanks