스프링 CrudRepository 인터페이스

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 02:50 판 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

CrudRepository
org.springframework.data.repository.CrudRepository
  • CRUD 기능을 제공하는 리파지토리 인터페이스
  • 대략 아래와 같이 선언하여 Repository로 사용
  • 부모: 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 }}