JPA란?
개념 정리

H2 Database
JPA
Hibernate
Spring Data JPA
Spring Boot 설정
pom.xml
application.yml
참조
Last updated

Last updated
<!-- h2 database -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>spring:
datasource:
driverClassName: org.h2.Driver
url: jdbc:h2:mem:testdb # testdb 스키마에 mem인 메모리 데이터 베이스로 동작
username: sa
password:
sql-script-encoding: utf-8
h2:
console:
enabled: true # h2 콘솔 사용
path: /h2 # localhost:port/h2 로 접근 가능
settings:
trace: false # Print additional trace information
web-allow-others: true # 브라우저로 접근가능하게 하기
jpa:
show-sql: true # sql 쿼리 콘솔 출력
properties:
hibernate:
format_sql: true # sql 보기좋게 출력
generate-ddl: false # @Entity 어노테이션 기준으로 DDL 작업 방지
hibernate:
ddl-auto: validate # 변경된 스키마가 있는지 확인