-->
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.  [ 4 posts ] 
Author Message
 Post subject: cascading hql delete
PostPosted: Thu Jul 14, 2005 11:11 am 
Newbie

Joined: Tue Sep 28, 2004 7:14 pm
Posts: 7
Hibernate version: 3.0.5

Are hibernate HQL deletes designed to cascade? I get a foreign key constraint error against a one-to-one mapped property when I attempt to delete an entity. The delete cascades correctly (and fully) if I load the entity and then delete. Is this the intended behavior?

Code:
//fails, fk constraint error on one-to-one mapped property
Session session = currentSession();
Transaction tx = session.beginTransaction();
session.createQuery("delete Foo where Id = '555555'").executeUpdate();
tx.commit();
closeSession();


Code:
//works, cascades to delete one-to-one
Session session = currentSession();
Transaction tx = session.beginTransaction();
Foo f = (Foo) session.load(Foo.class, "555555");
session.delete(f);
tx.commit();
closeSession();


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 14, 2005 1:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
No, they are not. However, we will be providing HQL-based cascade delete as a new language feature in 3.1.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 1:22 pm 
Newbie

Joined: Thu Oct 20, 2005 7:30 am
Posts: 2
Quote:
gavin wrote: No, they are not. However, we will be providing HQL-based cascade delete as a new language feature in 3.1.


Well, now we have 3.1. However, I cannot find this new language feature in the documentation. Can you tell me how to do?[/quote]

_________________
best regards
Kai-Uwe


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 1:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
There's this thing called JIRA that has this other thing called a roadmap:
http://opensource.atlassian.com/projects/hibernate/browse/HHH?report=com.atlassian.jira.plugin.system.project:roadmap-panel

Specifically:
http://opensource2.atlassian.com/projects/hibernate/browse/HHH-695


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.