-->
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.  [ 1 post ] 
Author Message
 Post subject: Hql table aliases..........
PostPosted: Tue Nov 30, 2010 7:08 am 
Newbie

Joined: Thu Nov 11, 2010 6:27 am
Posts: 4
Hi,

Here's my code:
String sqlQuery = "select CE.* from table CE";
sqlQuery += " where name = :name1";
Query query = sess.createSQLQuery(sqlQuery,"CE",t1.class);
query.setParameter("name1", name1);

This throws an error :
net.sf.hibernate.exception.SQLGrammarException: error performing findBySQL


Is this because I am setting alias to table but in where clause I am directly using column name without the alias name. So is it compulsory to use the alias name while accessing the column?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.