-->
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: Persitence order, bug in hibernate ?
PostPosted: Tue Aug 07, 2007 3:47 am 
Newbie

Joined: Wed May 23, 2007 4:09 am
Posts: 16
I am using latest version of hibernate.
I have many bags in my class.
Class A
bag b
bag c
bag d

When I save my object A, hibernate makes 4 SQL calls:
INSERT A
INSERT B
INSERT C
INSERT D

When I delete my object A, hibernate makes 4 SQL calls:
DELETE A
DELETE B
DELETE C
DELETE D

It should instead makes the calls in reverse order:
DELETE D
DELETE C
DELETE B
DELETE A

Actually, because it doesn't work this way, I have a lot of dependencies problems. I tried updating "Cascade.java" source file and now it works much better.

By the way I have the same issue when using subclass. The members of the subclass are first persited and then the members of the base class.
On save the based class should be persisted first, and on delete the child class should be deleted first.

Can someone tell me where I am wrong? I am surprise to have such an issue with hibernate because it appears to me to be a basic use of the ORM.

Regards.


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.