-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate 3 with all-delete-orphan
PostPosted: Tue Nov 15, 2005 5:11 pm 
Beginner
Beginner

Joined: Wed Jul 14, 2004 11:51 am
Posts: 43
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]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.