-->
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.  [ 2 posts ] 
Author Message
 Post subject: select 1 from .... HQL query gives undefined alias exception
PostPosted: Sat Aug 30, 2008 8:55 am 
Newbie

Joined: Sat Aug 23, 2008 1:30 pm
Posts: 4
Hi ALL ,

I get hibernate error “undefined alias”



org.hibernate.QueryException: undefined alias: 1



Can any one tell me wats wrong in the HQL query?



HQL QUERY :



select distinct mct.num ,

mct.iss ,

mct.ch,

mct.date ,

mpl.add ,

mct.jal,

mct.ref,

mpl.spons from

DTO1 mpl, DTO2 maa, DTO3 mct

where mct.add = maa.add and

maa.add = mpl.add and

mpl.spons = ‘TT’ and mct.num= 1231 and

not exists ( select 1 from DTO4 mtp WHERE mtp.jal = mct.jal )



Please let me know if you have any pointers.


Top
 Profile  
 
 Post subject: Re: select 1 from .... HQL query gives undefined alias excep
PostPosted: Mon Sep 01, 2008 4:08 am 
Newbie

Joined: Mon May 29, 2006 7:37 am
Posts: 4
Hi,
AFAIK there is no such ability to specify "pagination" is HQL. I.e. your code
Code:
select 1 from DTO4 mtp WHERE mtp.jal = mct.jal

is database-specific SQL, not HQL.

You could try to use SQL query.


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