-->
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: Update HQL statement
PostPosted: Fri Jul 15, 2005 7:56 am 
Newbie

Joined: Fri Jun 10, 2005 7:59 am
Posts: 5
Hi all,

I am using Hibernate 3, weblogic 8.1

my transaction code is


Session session = instance.sessionFactory.openSession();
Transaction tx = session.beginTransaction();
String newName="Jhon";
String oldName="Peter";

String hqlUpdate = "update Emp set ename = :newName where ename = :oldName and dept_id=8002";
int updatedEntities = session.createQuery( hqlUpdate )
.setString( "newName", newName )
.setString( "oldName", oldName )
.executeUpdate();
tx.commit();
session.close();


When i am using this from main() function it is working fine.

I am throwing an error when i use this code in weblogic server

My error is

Hibernate Exceptionorg.hibernate.QueryException: query must begin with SELECT or FROM:


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2005 7:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Sure you don't have an Old version of hibernate on the applications servers classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 16, 2005 11:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Also, make sure you are not using the "classic: parser; only the new antlr-based parser supports these statements.


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.