-->
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.  [ 3 posts ] 
Author Message
 Post subject: how to delete entity without loading it first?
PostPosted: Sun May 27, 2007 9:10 pm 
Newbie

Joined: Fri Feb 09, 2007 9:10 pm
Posts: 3
ISession.Delete() got 3 overloads that I could not find in Documentation on how to use it. The one I can use now is Isession.Delete(object obj) which I have to load object from db first before delete it. That is not a fast way to delete Entity.

Is there a way to delete entities by column name and value? (without having to write native SQL.)

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 28, 2007 2:23 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
There isn't any such way in NHibernate currently. The object has to be loaded to process cascades and potential lifecycle callbacks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 29, 2007 2:50 pm 
Regular
Regular

Joined: Mon May 08, 2006 6:00 am
Posts: 53
Location: India
I think you can use named query for such deletes


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