-->
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.  [ 3 posts ] 
Author Message
 Post subject: Updating a single field in HQL results in an exception
PostPosted: Tue Mar 28, 2006 10:54 pm 
Newbie

Joined: Thu Jan 13, 2005 11:41 pm
Posts: 10
I installed Hibernate 3.1.3 on Weblogic 8.1.
I've set the "hibernate.query.factory_class" property value to "org.hibernate.hql.classic.ClassicQueryTranslatorFactory".

For the update statement:

update Token set counter = :counter where id = :id


I'm getting the following:

"org.hibernate.QueryException: query must begin with SELECT or FROM: update [update com.symantec.eb.vo.TokenVO set....."


HQL support of updating single fields is part of 3.1.3, and therefore requires the new parser library antlr?
Currently, I haven't set it as the first thing in Weblogic's classpath as I'm not sure I'll be able to change it on our production machines.
Or am I barking at the wrong tree?

Are there any work arounds?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 28, 2006 11:27 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Isn't that just because you're using the classic parser? I can't see any reference to an update keyword in the classic parser, it simply doesn't support update.


Top
 Profile  
 
 Post subject: This is what I wanted to confirm
PostPosted: Wed Mar 29, 2006 1:43 pm 
Newbie

Joined: Thu Jan 13, 2005 11:41 pm
Posts: 10
As I'm new to Hibernate, I wanted to confirm that.
Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.