반응형
@Repository
-
04. 사용자 정의 리포지토리BackEnd/Spring Data JPA 2021. 10. 26. 19:30
Spring Data JPA Repository는 인터페이스만 정의하고 구현체는 스프링이 자동 생성합니다. 사용자 정의 Repository 구현 클래스 명명 규칙은 사용자 정의 인터페이스명 + "Impl" 이며, Spring Data JPA가 인식해서 Spring Bean으로 등록합니다. Impl 대신 다른 이름으로 변경 방법 // XML 설정 // JavaConfig 설정 @EnableJpaRepositories(basePackages = "study.datajpa.repository", repositoryImplementationPostfix = "Impl") 인터페이스의 메서드 직접 구현 방식 JPA 직접 사용(EntityManager) Spring JDBC Template MyBatis Datab..