시그마 삽질==six 시그마

findTopBy, findTopBy 본문

프로그래밍/JPA

findTopBy, findTopBy

Ethan Matthew Hunt 2020. 10. 22. 21:42

docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.limit-query-result

 

Spring Data JPA - Reference Documentation

Example 108. Using @Transactional at query methods @Transactional(readOnly = true) public interface UserRepository extends JpaRepository { List findByLastname(String lastname); @Modifying @Transactional @Query("delete from User u where u.active = false") v

docs.spring.io


User findFirstByOrderByLastnameAsc();

User findTopByOrderByAgeDesc();

Page<User> queryFirst10ByLastname(String lastname, Pageable pageable);

Slice<User> findTop3ByLastname(String lastname, Pageable pageable);

List<User> findFirst10ByLastname(String lastname, Sort sort);

List<User> findTop10ByLastname(String lastname, Pageable pageable);

List<Person> findByLastnameOrderByFirstnameAsc(String lastname);

List<Person> findByLastnameOrderByFirstnameDesc(String lastname);

 

'프로그래밍 > JPA' 카테고리의 다른 글

JPA 성능 최적화  (0) 2020.08.08
트랜잭션과 락 ,2차 캐시  (0) 2020.04.11
JPA- 영속성 관리  (0) 2020.04.10
스프링 데이터 JPA  (0) 2020.04.10
JPA -객체 지향 쿼리언어  (0) 2020.04.09
Comments