데이터 5~6부 : 스프링 데이터 JPA
Spring Data JPA -> JPA -> Hibernate -> Datasource - 의존성 추가 spring-boot-starter-data-jpa, - 실제 수행과 테스트를 위한 디비 의존성 추가 h2, postgresql - 클래스 생성 @Entity -> 테이블을 객체화 시켰다고 생각. @GeneratedValue -> repository를 통해 저장할 때, 자동으로 값을 준다 . Auto라고 생각. 기본적으로 id , getter,setter가 필요하다. getter,setter, equlas,hashCode 생성 , 롬복을 활용해도 좋다. - Repository interface 생성 extends JpaRepository - 테스트 @SpringbootTest로 통합 테스트, @Dat..
2020.07.12