스프링 데이터 JPA
-
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..
-
02. Spring Data JPABackEnd/Spring Data JPA 2021. 10. 25. 21:32
Spring Data JPA는 JPA 기반 Repositories를 쉽게 구현할 수 있는 모듈입니다. 사용자 정의 파인더 메소드를 포함하여 Repository 인터페이스를 작성하면 Spring이 자동으로 구현을 제공합니다. 특징 Spring과 JPA 기반 Repositories 구축 지원 Querydsl 지원 및 type-safe JPA 쿼리 도메인 클래스의 투명한 감사 Pagination 지원, 동적 쿼리 실행, custom data 접근 코드 통합 기능 부트스트랩 시간에 @Query 어노테이션이 있는 쿼리의 유효성 검사 XML 기반 엔티티 매핑 지원 @EnableJpaRepositories를 도입하여 JavaConfig 기반 저장소 구성 JpaRepository 인터페이스 JpaRepository 인..
-
01. 프로젝트 환경설정BackEnd/Spring Data JPA 2021. 10. 23. 12:20
1. 프로젝트 생성 2. 롬복 적용 1) Preferences plugin lombok 검색 실행 (재시작) 2) Preferences Annotation Processors 검색 Enable annotation processing 체크 (재시작) 3) 임의의 테스트 클래스를 만들고 @Getter, @Setter 확인 3. IntelliJ 설정 변경(실행속도 향상) 1) Preferences Build, Execution, Deployment Build Tools Gradle 2) Build and run using: Gradle IntelliJ IDEA 3) Run tests using: Gradle IntelliJ IDEA 4. H2 데이터베이스 설치 1) https://www.h2database.c..