Hello,
I have the following entities:
User {
List<UserAttribute> userAttributes;
}
Attribute {
string name;
}
UserAttribute {
User user;
Attribute attribute;
List<UserAttributeValue> values;
}
UserAttributeValue {
String strValue;
UserAttribute userAttribute;
}
For example: I would like to build a query to find User entities WHERE:
- one of the user.userAttributes.attribute.name equal to ='FIRST_NAME' AND
user.userAttributes.attribute.values.strValue equal to 'SOME_STRING'
But I would like to search for more than one attribute plus one of its values. so it can be multiple.
The problem is that user.userAttributes is a collection, also the userAttribute.values is a collection,
I have no idea how to do that,
Can someone give me a hint or refer me? I tried to read the HQL docs but I couldn't find any example with such a complicated scenario
Many thanks,
Asaf.
|