-->
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: Session.Delete(string query....) bug
PostPosted: Sun May 20, 2007 6:33 am 
Newbie

Joined: Mon Mar 19, 2007 2:44 pm
Posts: 2
This code:

session.Delete("FROM Foo f WHERE f.BooId = ?", 10, NHibernate.NHibernateUtil.Int32);

Generates SQL:

SELECT FROM ....

not

DELETE FROM ....

Is this a bug or have I missunderstod this delete method?

Hibernate version: 1.2.0.GA


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 21, 2007 8:06 am 
Senior
Senior

Joined: Thu Feb 09, 2006 1:30 pm
Posts: 172
I believe the Delete method makes persistent objects transient objects, and when a flush occurs will remove the item from the database. I believe that when you pass HQL to a delete method it needs to first load the objects you want to delete, and then later gets deleted with the flush command. This then can ensure proper handling within NHibernate, such as cascade="delete".


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.