Anda tidak dapat menggunakan toLocalDate()
langsung di JPQL. Cara yang lebih mudah untuk memperbaiki penghitungan awal hari dan akhir hari localdate
dan lakukan di antara kueri menggunakan mereka.
LocalDateTime startOfDay = localDate.atTime(LocalTime.MIN);
LocalDateTime endOfDay = localDate.atTime(LocalTime.MAX);
dan kueri seperti c.start between BETWEEN :startOfDay AND :endOfDay
@Query("SELECT new com.proctorio.webtracker.entity.WebsiteDailyTotal(c.domain, SUM(c.duration)) "
+"FROM SuperStatEntityTime AS c WHERE c.start between BETWEEN :startOfDay AND :endOfDay GROUP BY c.domain ORDER BY c.domain ASC")
public List<WebsiteDailyTotal> countTotalDomainUsageByDay2(@Param("startOfDay") LocalDateTime startOfDay,
@Param("endOfDay") LocalDateTime endOfDay);