> -----Original Message-----
> From: Pinaki Poddar [mailto:[email protected]]
> Sent: Tuesday, June 01, 2010 9:01 AM
> To: [email protected]
> Subject: Re: Query for union of child list
> 
> 
> > 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();

Unfortunately, I'm limited to OpenJPA 1.x for now.  What I have works, I
just wanted to know if there was a better way to do it.

Reply via email to