I'd like to get objects with create_date = :my_date
where create_date
is in 2014-12-02 14:49:15.029
format and my_date
is in 2014-12-02
format in JPA.
Is there any way to compare timestamp column with Date object (yyyy-MM-dd format) in JPQL using NamedQuery
or should I use native query?
If you are using jpql try to use
date(timestamp_column)
eg :
@Query(select te from Testentity te where date(te.createdTimestamp) >= CURRENT_DATE)
public List<Testentity> getTestDate()