-->
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: UnsupportedOperationException: Native SQL update
PostPosted: Wed Jul 04, 2007 9:49 am 
Newbie

Joined: Thu Jun 22, 2006 12:22 am
Posts: 9
Hi,

While triying to execute an update query using native SQL ,i'm getting an exception as follows.

[b]java.lang.UnsupportedOperationException: Update queries only supported through HQL
at org.hibernate.impl.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:607)[/b]

My code is like
[code]
session.createSQLQuery("UPDATE ITEM set name='hib' WHERE itemid=1").executeUpdate()[/code]

I can change to HQL, but I like to know why this exception is thrown.

Why is native SQL for update not supported by Hibernate.

Thanks in Advance
Chandrasekhar S


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 1:24 am 
Newbie

Joined: Thu Jun 22, 2006 12:22 am
Posts: 9
Hi,

When i changed my version to hibernate3.2 its working.


Thanks
Chandrasekhar S


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.