Pagination in Spring Data JPA (limit and offset)
I want the user to be able to specify the limit (the size of the amount returned) and offset (the first record returned / index returned) in my query method. Here are my classes without any paging capabilities. My entity: @Entity public Employee { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int id; @Column(name="NAME") private String name; //getters and setters } My repository: public interface EmployeeRepository extends JpaRepository<Employee, Integer> { @Query("SELECT e FROM Employee e WHERE e.name LIKE :name ORDER BY e.id") public List<Employee> findByName(@Param("name")