diff --git a/build.gradle b/build.gradle index ad496dd..a124aac 100644 --- a/build.gradle +++ b/build.gradle @@ -24,12 +24,12 @@ repositories { } dependencies { - //implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' // swagger compileOnly 'org.projectlombok:lombok' - //runtimeOnly 'com.mysql:mysql-connector-j' + runtimeOnly 'com.mysql:mysql-connector-j' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' diff --git a/src/main/java/com/umc/dream/DreamApplication.java b/src/main/java/com/umc/dream/DreamApplication.java index 66d9e63..f4f5a00 100644 --- a/src/main/java/com/umc/dream/DreamApplication.java +++ b/src/main/java/com/umc/dream/DreamApplication.java @@ -2,7 +2,9 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +@EnableJpaAuditing @SpringBootApplication public class DreamApplication { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index de6af51..31cb7b5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,7 +1,25 @@ spring: application: name: dream - + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${DB_URL} + username: ${DB_USER} + password: ${DB_PASSWORD} + sql: + init: + mode: never + jpa: + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL8Dialect + show_sql: true + format_sql: true + use_sql_comments: true + hbm2ddl: + # auto: create + auto: update + default_batch_fetch_size: 1000 springdoc: swagger-ui: