I am trying to check if an entry to the DB has occurred today. My Query works when I run it with MySqlWorkbench, but when I use hibernate the query does not seem to work correctly I am always returned true even though the DB does have dates today.
The query is:
@Query("SELECT CASE WHEN (count(ent) < 1) then true else false end
FROM Entity ent WHERE ent.createdAt >= (?1)")
boolean checkIfEnteredToday(Date date);
The date is from the java.sql.Date library.