openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michel Ganguin <gang...@gmail.com>
Subject Re: left join with filter on joined table
Date Wed, 28 Oct 2009 11:11:56 GMT

Thanks
This should solve at least a part of my problem, but a cannot make it work.
I use opejpa 1.2.1 and it raises a parseexception on such a query. Is "case
when" valid in jpql?

Michel


Fay Wang wrote:
> 
> Hi,
>    You might want to try:
> 
> Select p.firstname, 
>       Case v.type WHEN 'v1' THEN v.type 
>                         WHEN 'v2' THEN 'null' 
>                         ELSE 'null' END " +
>        from Patient p left join p.vaccinCollection v
> 
> However, this approach still requires post-processing of 'null' string to
> null value. 
> 
> Fay
> 

-- 
View this message in context: http://n2.nabble.com/left-join-with-filter-on-joined-table-tp3893996p3904795.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message