Friday, September 3, 2021

How to query JPA LocalDate field with a LocalDate value?


Use @Query and cast column using DATE()


@Query(value = "SELECT * FROM Entity u WHERE DATE(creation_date) = ?1", nativeQuery = true)

List<Entity> findByCreationDate(LocalDate date);

No comments:

Post a Comment