-->
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: Quering complicated mappings
PostPosted: Thu Feb 12, 2009 12:45 pm 
Newbie

Joined: Mon Nov 14, 2005 5:17 am
Posts: 13
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.


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.