我需要從資料庫中的 LocalDateTime 檢索不同的 LocalDate。我可以使用 Spring 資料 JPA 或 SQL 原生查詢。
uj5u.com熱心網友回復:
我認為你可以這樣做:
@Query(value="select * from posts where published_at Between ?1 And ?2", nativeQuery = true)
Page<Posts> findAllPostsByPublishedDate(LocalDate dateFrom, LocalDate dateTo, Pageable pageable);
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/514695.html
下一篇:在范圍內插入id
