CURRENT_DATE in EclipseLink/JPA
876866Jul 20 2011 — edited Jul 21 2011When I use CURRENT_DATE in JPA queries for date comparisions, it seems to be taking time into consideration as well. So when I comapre a date with CURRENT_DATE, even though the date I am comparing is today's date, the results state that CURRENT_DATE is greater because it takes the current time into consideration. Based on docs CURRENT_DATE in JPA queries is for Date only.
CURRENT_DATE: Returns the current date.
CURRENT_TIME: Returns the current time.
CURRENT_TIMESTAMP: Returns the current timestamp.
http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e13946/ejb3_overview_query.html
My query
SELECT a FROM Approval a WHERE a.dateRange.endDate >= CURRENT_DATE
In this case even though the endDate is todays's date, I get no results back because the end date has only date while the CURRENT_DATE has teh current time stamp as well.
I would gretaly appreciate it if anyone has some ideas about this and can help me.