2019-06-18发表2022-02-22更新Java随记2 分钟读完 (大约330个字)记一个Spring Data JPA自定义分页查询BUG官方给出的自定义分页查询的示例是这样的: 123456public interface UserRepository extends JpaRepository<User, Long> { @Query(value = "SELECT * FROM USERS WHERE LASTNAME = ?1", countQuery = "SELECT count(*) FROM USERS WHERE LASTNAME = ?1", nativeQuery = true) Page<User> findByLastname(String lastname, Pageable pageable);}阅读更多