-->
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: Please help me with a hql query
PostPosted: Fri Oct 30, 2009 12:21 am 
Newbie

Joined: Mon Jun 20, 2005 12:20 pm
Posts: 17
Hi, I have the following classes:

Code:
class Object {
  Set<AbstractProperty> properties;
}

class DateProperty implements AbstractProperty {
  Date value;
}

class ChoiceProperty implements AbstractProperty {
  Set<Choice> value;
}

class Choice {
  long choiceId;
}


I want to find all Objects whose ChoiceProperty's value contain 2 Choices with choiceId equal to 1 and 4 like

Quote:
select distinct o from Object o left join o.properties p
where p.value = all elements(from Choice c where c.choiceId in (1,4))


It looks like that I cannot put a query inside elements(). Unfortuntely, I have choiceId (not Choice instances). Any help will be appreciated.

Regards,
-ZJ


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.