Java Pagination Posted on 2018-08-03 | In Java | 1. Spring Data Pagination Spring Data Pagination @Query(value = "SELECT\n" + " t.* FROM schema.TABLE t\n" + " WHERE t.DATETIME >= ?1 AND t.DATETIME < ?2\n" + " ORDER BY ?#{#pageable}", countQuery = "SELECT\n" + " COUNT(*) FROM schema.TABLE t\n" + " WHERE t.DATETIME >= ?1 AND t.DATETIME < ?2", nativeQuery = true)Page<Entity> getEntityPageable(String startDate, String endDate, Pageable pageable);Page<Entity> findByDatetimeAfterAndDatetimeBefore(Timestamp startDate, Timestamp endDate, Pageable pageable);