Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JPQL query date/datetime problem
JPQL query date/datetime problem [message #667490] Fri, 29 April 2011 06:50 Go to next message
Pavel Zelenka is currently offline Pavel ZelenkaFriend
Messages: 61
Registered: July 2009
Member
Hi,

in MySQL table there is a field which contains datetime value. I need to compare this to only date value. Is there any solution in JPQL or I need to use native query?

Thanks
Re: JPQL query date/datetime problem [message #667915 is a reply to message #667490] Mon, 02 May 2011 18:38 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The JPQL spec does not provide any date conversion functions, but EclipseLink does provide a FUNC() JPQL function that allows usage of database function calls. The database function you use would be specific to your database, such as DATEPART().

EclipseLink Expressions also define several date functions not currently supported in JPQL.

You could also query that the date-time is between two Timestamp from 0 to midnight, this should be the same as checking the date only.


James : Wiki : Book : Blog : Twitter
Previous Topic:Avoiding N+One Selects and stale BatchValueHolders
Next Topic:Does flush() sync with the db or the L2 cache?
Goto Forum:
  


Current Time: Fri Mar 29 13:02:50 GMT 2024

Powered by FUDForum. Page generated in 0.02500 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top