"스프링 CrudRepository 인터페이스"의 두 판 사이의 차이

14번째 줄: 14번째 줄:
! 메소드 !! 설명
! 메소드 !! 설명
|-
|-
| count() || 개수
| count() || 개수 확인
|-
|-
| delete() || 1건 또는 여러 건 삭제
| delete() || 1건 또는 여러 건 삭제

2016년 6월 29일 (수) 10:28 판

1 개요

CrudRepository
org.springframework.data.repository.CrudRepository
  • 대략 아래와 같이 선언하여 Repository로 사용
@Repository
public interface PersonRepository extends CrudRepository<Person, Long> {

}

2 메소드

메소드 설명
count() 개수 확인
delete() 1건 또는 여러 건 삭제
deleteAll() 모두 삭제
exists() ID 있는지 확인
findAll() 전체 또는 ID목록으로 조회
findOne() ID로 조회
save() 1건 또는 여러 건 저장

3 같이 보기

4 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}