백엔드/JPA
                
              JPA 페이징
                팩트폭력배
                 2012. 11. 15. 15:24
              
                          
            
http://wiki.eclipse.org/EclipseLink/Examples/JPA/Pagination
위 내용 중 쉽게 쓸만 한 것은 아래 코드이다.
예제에는 오라클이라 되어 있는데 MySQL도 사용 가능하다.
 
위 내용 중 쉽게 쓸만 한 것은 아래 코드이다.
Query query = em.createQuery("SELECT e FROM Employee e ORDER BY e.lastName ASC, e.firstName ASC");
query.setFirstResult(5);
query.setMaxResults(5);
List emps = query.getResultList();
 
예제에는 오라클이라 되어 있는데 MySQL도 사용 가능하다.