UnsupportedOperationException « Update « JPA Q&A





1. UnsupportedOperationException: Native SQL update    forum.hibernate.org

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 ...