openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Query for union of child list
Date Tue, 01 Jun 2010 16:00:55 GMT

> I need to get a list of all the unique "Foo" objects in the "childFoos"
list for all "Device" objects. 

  JPA 2.0 introduced a new entity type expression for JPQL which may be
useful here.
  I will expect something like (provided Product-Foo is a bi-directional
relation)

  String jpql = "select f from Foo f where f.parent = :subtype";
  em.createQuery(jpql)
     .setParameter("subtype", Device.class)
     .getResultList();




-----
Pinaki 
-- 
View this message in context: http://openjpa.208410.n2.nabble.com/Query-for-union-of-child-list-tp5114989p5126735.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message