openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject Need to implement query with NULLIF with OpenJPA 1.2.2
Date Fri, 04 Jun 2010 18:18:44 GMT
Using OpenJPA 1.2.2 (I can't upgrade).

I have to do a query that gets rows where the current date is between a
start/end date range, but if either of the "start" or "end" date is
null, to instead compare it against a date value in a one-to-one
relationship.  This seems like a perfect place to use NULLIF.  NULLIF is
defined in JPA 2.x, but not in 1.x.  Unfortunately, due to restrictions
in my container, I can't run OpenJPA 2.x (running JPA 2.x in WebLogic
10.3 requires significant surgery that I'm not able to do yet).

I know I could use a native query, but I'm hoping that's a last resort.

Can you think of any other strategies I could use?

Mime
View raw message