-->
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 - filtering pojo by association's scalar collection elem
PostPosted: Thu Jun 07, 2007 11:37 am 
Newbie

Joined: Fri Mar 16, 2007 6:04 am
Posts: 14
Hello,

I have a Member pojo:

Code:
class Member {
long id;
Country country;
}


Code:
class Country {
long id;
Map titles; // {Locale= String}
}


Map contains Locales and the country title for the specific locale.
I want to get all Members ordered by the titles of their countries for a specific locale. Criteria query does not support this so I am trying to do so using hql.
Using the indices function, I can match the locale that I desire, by I can't seem to be able to achieve the ordering.

My query is:

Code:
from Member 
where :locale in indices(country.titles)
order by elements(country.titles)


which of course produces an error. I there I way I can request something like this?? Which of course also produces an error:

Code:
from Member 
where :locale in indices(country.titles)
order by country.titles.title



Thanks,

akz


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.