SpringBoot에서 JPA 설정 방법

김엄지·2024년 2월 25일
0

Spring

목록 보기
4/21

build.gradle에서 코드 넣기

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

application.properties 에서 Hibernate 설정


spring.jpa.hibernate.ddl-auto=update

spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true
  • application.properties는 Spring과 관련된 설정을 할 때 사용되는 파일입니다.
  • 이 파일을 사용하면 자동으로 설정되고 있는 설정 값을 쉽게 수정할 수 있습니다.
  • DB 연결 시 DB의 정보를 제공해야하는데, 이 파일을 이용하여 쉽게 값을 전달할 수 있습니다.
profile
나만의 무언가를 가진 프로그래머가 되자

0개의 댓글