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