-->
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.  [ 2 posts ] 
Author Message
 Post subject: cascade="delete" automatically set by reverse engi
PostPosted: Fri May 25, 2007 5:08 am 
Regular
Regular

Joined: Thu Apr 05, 2007 7:05 am
Posts: 53
Location: Troisdorf, Germany
Hi,

I want that my mapping files contains this code cascade="delete" for each set, but also only for sets! Which function of the DelegatingReverseEngineeringStrategy is the one where I can change that? Or is there no function which will help me. If not, how can I do this then?

I also read something about a default-cascade attribute. I think I could use this too. But here again is the same question. How can I set it automatically when I"m generating the files.

Hibernate version: 3.2 beta 8
Name and version of the database you are using: Oracle 10g

What I have:
Code:
<set name="atoms" inverse="true">
            <key>
                <column name="MOLECULE_ITEM_ID" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="de.fhg.scai.bio.csr.io.database.hibernate.DatabaseAtom" />
        </set>


What I want:
Code:
<set name="atoms" inverse="true" cascade="delete">
            <key>
                <column name="MOLECULE_ITEM_ID" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="de.fhg.scai.bio.csr.io.database.hibernate.DatabaseAtom" />
        </set>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 10:50 am 
Regular
Regular

Joined: Thu Apr 05, 2007 7:05 am
Posts: 53
Location: Troisdorf, Germany
Okay, after nobody seems to be able to help me perhaps somebody can explain me how I can delete a item which has children. When I delete the children first I get the message "ORA-02291: integrity constraint (CSR.SYS_C0025073) violated - parent key not found" and when I want to delete the item itself I get a message that there are still children. Perhaps the problem is that I don"t have a normal foreign key. I use a 1:n non-identifying relation, but I think at least I should be able to delete the children, or?


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

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.