If you don't mind the functions specific to the database, you can do it (using Oracle as an example).
@Query("FROM Item item WHERE trunc(item.date) = trunc(:date) " )
List<Item> findByDate(@Param("date") Date date);
You can use this because OracleDialect registers truncas StandardSQLFunction, and Oracle truncremoves the time component of the date.
source
share