-->
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: Query.executeUpdate not returning number of deleted entities
PostPosted: Thu Jan 26, 2006 11:18 am 
Newbie

Joined: Thu Oct 21, 2004 7:02 am
Posts: 14
Hibernate version: 3.0.5

Code between sessionFactory.openSession() and session.close():

String hqlDelete = "delete DataValue where source = :source";

int deletedDataValues = session.createQuery( hqlDelete )
.setString( "source", source )
.executeUpdate();

return deletedDataValues;

Name and version of the database you are using: HSQLDB v. 1.7.3.3

Hi,

I was wondering if Query.executeUpdate() always return the number of deleted entities, or of this may depend on the database I'm using? The code above always return 0 (when testing with hsqldb), but all the entities that matches the query are deleted.

--
Cheers,
Kristian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 1:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Well it is obviously relying on the database to return the proper number of affected rows to acheive this return value. I've not tried with that old of a version of HSQLDB. I run the tests against 1.8.0 and they work fine


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.