-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problem with query with alias for property
PostPosted: Tue Apr 12, 2011 3:41 am 
Newbie

Joined: Mon Apr 11, 2011 4:19 am
Posts: 11
Hi,

I have a problem with the below query,

Caused by: org.hibernate.QueryException: , expected in SELECT [SELECT s.id AS id, s.status AS status, s.firstName AS companyName FROM Student AS s ORDER BY s.firstName asc]

What would be the problem with the query ?

The same query works fine when I remove the aliases been given for the properties.

Meaning: SELECT s.id, s.status, s.firstName FROM Student AS s ORDER BY s.firstName asc -- works fine

Thanks,
Senthilkumar Arumugam


Top
 Profile  
 
 Post subject: Re: Problem with query with alias for property
PostPosted: Tue Apr 12, 2011 6:44 am 
Beginner
Beginner

Joined: Mon Apr 04, 2011 3:31 am
Posts: 41
hey read this

http://www.roseindia.net/hibernate/hibe ... mple.shtml

_________________
Thanks
Niki


Top
 Profile  
 
 Post subject: Re: Problem with query with alias for property
PostPosted: Tue Apr 12, 2011 7:16 am 
Newbie

Joined: Mon Apr 11, 2011 4:19 am
Posts: 11
niks23 wrote:


I am not able to relate this example with the Exception I am facing.


Top
 Profile  
 
 Post subject: Re: Problem with query with alias for property
PostPosted: Tue Apr 12, 2011 8:49 am 
Beginner
Beginner

Joined: Mon Apr 04, 2011 3:31 am
Posts: 41
http://docs.jboss.org/hibernate/entitym ... ryhql.html

_________________
Thanks
Niki


Last edited by niks23 on Wed Apr 13, 2011 6:26 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Problem with query with alias for property
PostPosted: Tue Apr 12, 2011 9:06 am 
Regular
Regular

Joined: Fri Jan 28, 2011 11:44 am
Posts: 117
@niks23
Did you at least read the question before posting your answer?
Your 2 posts are not even related to the subject ... the problem does not come from the order-by clause and he is using HQL not SQL


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