users@glassfish.java.net

Re: problem with JPA query for date handling

From: <glassfish_at_javadesktop.org>
Date: Mon, 05 Jul 2010 10:54:10 PDT

continuation of the query:
But the result is not as expected. It looks like it gives all results always. I am not getting records as i wish (greater than today or between two given date). When i googled, i feel the problem is the date sent from java is java Date format like Thu Jul 01 00:00:00 CEST 2010 whereas the data is DB is stored in Oracle Date format like 01-JUL-10.

So I feel we need to convert the date value before sending to oracle. I tried simpledateformat conversion, to_date, to_char, DATE() but they all work in native query and fails in JPAQL. Can someone suggest how to resolve the problem?
[Message sent by forum member 'kewlbuddy']

http://forums.java.net/jive/thread.jspa?messageID=476810