JPA query by Date range when date is INSTANT

34 Views Asked by At

Spring data could resolve parameter of my method. I have this method and receive

Could not determine data type of parameter $1

d.date is a timestamp

@Query("SELECT d FROM DTO d WHERE d.date BETWEEN :startDate AND :endDate)                        

List<DTO> findAllByDateRange(@Param("startDate") Instant startDate, @Param("endDate") Instant endDate); 

I've tried to cast it to timestamp but it didn't help.

0

There are 0 best solutions below