| Author |
Hibernate: Native SQL [update]
|
Chandra Sekhar
Ranch Hand
Joined: Sep 26, 2003
Posts: 90
|
|
Hi, While triying to execute an update query using native SQL ,i'm getting an exception as follows. java.lang.UnsupportedOperationException: Update queries only supported through HQL at org.hibernate.impl.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:607) My code is like 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
|
"Luck is when opportunity meets preparation"
|
 |
Chandra Sekhar
Ranch Hand
Joined: Sep 26, 2003
Posts: 90
|
|
Hi, When i changed my version to hibernate3.2 its working. Thanks Chandrasekhar S
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
Indeed, there shouldn't be a problem with a native query update using Hibernate. The following works fine on Hibernate 3.2.5 on MySQL:
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
 |
|
|
subject: Hibernate: Native SQL [update]
|
|
|