Skip to content

Commit

Permalink
Feat: DB, JPA 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yslle committed Jul 4, 2024
1 parent 84bb3a8 commit 17d0d88
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/umc/dream/DreamApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
20 changes: 19 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 17d0d88

Please sign in to comment.