You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Pinaki Poddar <pp...@apache.org> on 2008/04/01 00:52:28 UTC

Re: JPQL Query on Collection

The JPQL in the previous post is not correct, the correct one should be 

String jpql = "SELECT p FROM MyObject p WHERE ?1 MEMBER OF p.users";

while in previous post, I wrote

String jpql = "SELECT p FROM MyObject p WHERE ?1 MEMBER OF users";




-- 
View this message in context: http://www.nabble.com/JPQL-Query-on-Collection%3CString%3E-tp16347010p16399137.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: JPQL Query on Collection

Posted by Johannes Koch <jo...@sap.com>.
What would this look like if the collection is not a Set but a Map? I was
able to persist the map correctly and can retrieve objects with map
attributes from the database, but how can I query to receive only those
entities with a specific (key,value) pair in their map attribute? What I
tried is
String jpql = "SELECT p FROM MyObject p WHERE (?1,?2) MEMBER OF
p.myMapAttribute";
but this only gets me a org.hibernate.hql.ast.QuerySyntaxException:
unexpected end of subtree
-- 
View this message in context: http://www.nabble.com/JPQL-Query-on-Collection%3CString%3E-tp16347010p16853894.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.