-->
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: deleting by primary key
PostPosted: Thu Nov 20, 2003 2:34 pm 
Newbie

Joined: Wed Nov 19, 2003 3:31 pm
Posts: 4
Is there a way in Hibernate to delete a row in the database without
having to load the object's data into memory ?

net.sf.hibernate.Session does not offer any method that deletes
rows by primary key.

I've noticed in the logs that even the method
delete( String query )
first loads objects into memory, and then deletes them.

Maybe I'm missing something, but I think that a method that
lets me delete an object without having to load it into memory
should be very useful and performance-wise in some cases.

Santiago


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 2:50 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
What about constraints related to objects you delete (cascade all etc) ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 2:57 pm 
Newbie

Joined: Wed Nov 19, 2003 3:31 pm
Posts: 4
epbernard wrote:
What about constraints related to objects you delete (cascade all etc) ?


You're right, I haven't thought about that.

Maybe the framework could detect if cascades apply to that object,
and perform the loading only in those cases.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 9:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
its also Lifecycle callback, collections, etc....


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.