Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.2
Mapping documents:
Code:
<set name="relatedFromListNodes" table="RELATED_LISTNODE"
inverse="true" cascade="save-update,remove,delete" lazy="extra">
<key column="to_listnode_id" not-null="true"/>
<many-to-many class="ListNode" column="from_listnode_id"/>
</set>
<set name="relatedToListNodes" table="RELATED_LISTNODE"
inverse="false" cascade="save-update,remove,delete" lazy="extra">
<key column="from_listnode_id" not-null="true"/>
<many-to-many class="ListNode" column="to_listnode_id" />
</set>
Code between sessionFactory.openSession() and session.close():Code:
list.getRelatedFromListNodes().clear();
list.getRelatedToListNodes().clear();
Name and version of the database you are using:
MySQL 5.0
The generated SQL (show_sql=true):
There is no "update" sql
A ListNode object has relations with other ListNode objects.
I use many-to-many relation and use RELATED_LISTNODE table.
but when I want to remove all the relations of some ListNode object, it does not work.
I just want to remove "RELATIONSHIP between objects", not to delete the orther objects.
How can I do that? I couldn't find any solutions.
Thankds