-->
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: Delete using Native SQL not supported in H3.1!?
PostPosted: Wed Nov 23, 2005 6:57 am 
Beginner
Beginner

Joined: Tue Jul 19, 2005 4:03 am
Posts: 34
Location: Aberdeen, UK
I am using Hibernate 3.0.5

The issue is that we want to executes some bulk deletes on the system using Native SQL.

Code:
SQLQuery query = session.createSQLQuery("delete from some_table");query.executeUpdate();


But this query is casing an error

Code:
Caused by: java.lang.UnsupportedOperationException: Update queries only supported through HQL at org.hibernate.impl.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:749)



I read other discussions in the forum that this is not possible using H3.0, but should be possible in H3.1 (!!??) So I upgraded to H3.1rc3, but the same error occurred.

My question: Will this be possible in H3.1 or will I be forced to go down the route of executing the batch deletes using the JDBC connection?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 23, 2005 7:17 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
session.connection().createStatement(SQL);
session.createQuery(HQL);


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.