Compare two dates with JPA
- by Kiva
Hello everybody,
I need to compare two dates in a JPQL query but it doesn't work.
Here is my query:
Query query = em.createQuery("SELECT h FROM PositionHistoric h, SeoDate d WHERE h.primaryKey.siteDb = :site AND h.primaryKey.engineDb = :engine AND h.primaryKey.keywordDb = :keyword AND h.date = d AND d.date <= :date ORDER BY h.date DESC");
My parameter date is a java.util.Date
My query return a objects list but the dates are upper and lower to my parameter.
Someone kown how to do this ?
Thanks.