date operations in jpql queries
- From: jasiu85 <jasiu85@xxxxxxxxx>
- Date: Mon, 15 Oct 2007 06:33:20 -0700
Hi,
I have two questions regarding JPQL and operations on dates and times:
1)
I have a table where I store datetime intervals, like this: (dt_start,
dt_end). I want to find all intervals that contain given date, i.e.
those for which following inequality holds: dt_start <= given_date AND
given_date < dt_end. How to write such query in JPQL?
2)
How can I add some seconds to a date in JPQL? Can I build an
expression like that?
I'm using MySQL and I can write those queries in its SQL, so I could
use native queries, but I'd like to stick to JPQL, if possible.
Regards,
Mike
.
- Follow-Ups:
- Re: date operations in jpql queries
- From: simas
- Re: date operations in jpql queries
- Prev by Date: Java Applet gets error accessing DB: (java.net.SocketPermission ... resolve)
- Next by Date: Re: Finding valid ENUM values
- Previous by thread: Java Applet gets error accessing DB: (java.net.SocketPermission ... resolve)
- Next by thread: Re: date operations in jpql queries
- Index(es):