-->
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: problem while getting list element from entity in hql query
PostPosted: Mon Feb 28, 2011 6:54 am 
Newbie

Joined: Mon Feb 28, 2011 6:45 am
Posts: 1
select aliasname.listelement from entity is working fine for me with out any porblems...

But if i am writing :-

select aliasname.string, aliasname.listelement from entity I am getting missign expression error ...i dont want to get the entire entity as it is too heavy. can some one suggest me a way at the earliest.


Top
 Profile  
 
 Post subject: Re: problem while getting list element from entity in hql query
PostPosted: Wed Mar 02, 2011 11:27 pm 
Newbie

Joined: Mon Jan 31, 2011 11:22 pm
Posts: 6
I think you can join the two related tables and project the attributes that you want to select.

i.e.


select aliasname.string, aliasname2.attribute from entity aliasname join aliasname.listelement aliasname2;


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.