Hibernate version: 3.0 beta 4
Name and version of the database you are using: MySQL 4.1.17
Hello,
I am having problems with deleting orphans of my beans. I used to work only with the cascade="all" attribute and discovered that there was the option cascade="all,delete-orphan". Unfortunately, right now this doesn't change anything, I still can't delete the orphans when deleting the parent.
I have many questions:
I use xdoclet and xdoclet generates the following mapping for my set:
Code:
<class
name="org.mdarad.samples.petstore.entities.Product"
table="PRODUCT"
lazy="false"
dynamic-update="true"
optimistic-lock="version"
>
....
<set
name="items"
lazy="false"
cascade="all-delete-orphan"
sort="unsorted"
>
<key
column="PRODUCT_FK"
>
</key>
<one-to-many
class="org.mdarad.samples.petstore.entities.Item"
/>
</set>
....
</class>
In the documentation of hibernate 3 (
http://www.hibernate.org/hib_docs/v3/reference/en/html/objectstate.html#objectstate-transitive), it states that the value of the cascade should be: "all,delete-orphan". XDoclet generates "all-delete-orphan" (dash instead of comma). Is this equivalent or is this an xdoclet bug.
Secondly, am I not using the mapping correctly?
Any help would be greatly appreciated.
François[/list]