Hello,
I've got a problem with a many-to-many relation on the same table.
There is an operation-class which consists of predecessor and successor (both are operations as well)
There are no problems in reading from the database, but when I want to add a new operation only the operation is saved and not the relations in table "presuc", which contains the ids. I know that in "ordinary" many-to-many cases you have to use the property : inverse=true. I've already tried this but the problem was the same.
I'm using hibernate 3.
this is my code from the mapping file:
Code:
<class name="portlet.model.Operation" table="OPERATION">
<id name="id" column="IDOP">
<generator class="native"/>
</id>
<property name="name"/>
<set name="predecessor" table="PRESUC" lazy="false" cascade="all">
<key column="IDSuc" not-null="true"/>
<many-to-many column="IDPre" class="portlet.model.Operation"/>
</set>
<set name="successor" table="PRESUC" lazy="false" cascade="all">
<key column="IDPre" not-null="true"/>
<many-to-many column="IDSuc" class="portlet.model.Operation"/>
</set>
</class>
Does anyone have an idea?