openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject RE: Need to implement query with NULLIF with OpenJPA 1.2.2
Date Fri, 04 Jun 2010 22:08:12 GMT
> -----Original Message-----
> From: KARR, DAVID (ATTSI)
> Sent: Friday, June 04, 2010 11:19 AM
> To: users@openjpa.apache.org
> Subject: Need to implement query with NULLIF with OpenJPA 1.2.2
> 
> 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?

Note that I meant "COALESCE", not "NULLIF".

Mime
View raw message