티스토리 뷰

반응형

리포지터리의 메서드명은 데이터를 조회하는 쿼리문의 where 조건을 결정하는 역할을 한다.

 

항목                   예제                                                                                    설명

And findBySubjectAndContent(String subject, String content) 여러 컬럼을 and 로 검색
Or findBySubjectOrContent(String subject, String content) 여러 컬럼을 or 로 검색
Between findByCreateDateBetween(LocalDateTime fromDate, LocalDateTime toDate) 컬럼을 between으로 검색
LessThan findByIdLessThan(Integer id) 작은 항목 검색
GreaterThanEqual findByIdGraterThanEqual(Integer id) 크거나 같은 항목 검색
Like findBySubjectLike(String subject) like 검색
In findBySubjectIn(String[] subjects) 여러 값중에 하나인 항목 검색
OrderBy findBySubjectOrderByCreateDateAsc(String subject) 검색 결과를 정렬하여 전달
반응형
반응형
최근에 올라온 글
Total
Today
Yesterday
글 보관함