From 7f3ea50313e0f823936a239dfabe9fe54754fcdd Mon Sep 17 00:00:00 2001 From: haerong22 Date: Wed, 29 Jun 2022 03:01:57 +0900 Subject: [PATCH] #13 spring db: mybatis - setting --- spring-db/build.gradle | 2 ++ spring-db/src/main/resources/application.properties | 7 ++++++- spring-db/src/test/resources/application.properties | 7 ++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/spring-db/build.gradle b/spring-db/build.gradle index 3ce3b13f..6d16daa9 100644 --- a/spring-db/build.gradle +++ b/spring-db/build.gradle @@ -23,6 +23,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-jdbc' + implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2' + runtimeOnly 'com.h2database:h2' compileOnly 'org.projectlombok:lombok' diff --git a/spring-db/src/main/resources/application.properties b/spring-db/src/main/resources/application.properties index 7e2aeb22..20cda924 100644 --- a/spring-db/src/main/resources/application.properties +++ b/spring-db/src/main/resources/application.properties @@ -4,4 +4,9 @@ spring.datasource.url=jdbc:h2:tcp://localhost/~/test spring.datasource.username=sa #jdbcTemplate sql log -#logging.level.org.springframework.jdbc=debug \ No newline at end of file +#logging.level.org.springframework.jdbc= + +#Mybatis +mybatis.type-aliases-package=hello.itemservice.domain +mybatis.configuration.map-underscore-to-camel-case=true +logging.level.hello.itemservice.repository.mybatis=trace \ No newline at end of file diff --git a/spring-db/src/test/resources/application.properties b/spring-db/src/test/resources/application.properties index 5d3f7ddb..b66a3fd8 100644 --- a/spring-db/src/test/resources/application.properties +++ b/spring-db/src/test/resources/application.properties @@ -4,4 +4,9 @@ spring.profiles.active=test #spring.datasource.username=sa #jdbcTemplate sql log -logging.level.org.springframework.jdbc=debug \ No newline at end of file +logging.level.org.springframework.jdbc=debug + +#Mybatis +mybatis.type-aliases-package=hello.itemservice.domain +mybatis.configuration.map-underscore-to-camel-case=true +logging.level.hello.itemservice.repository.mybatis=trace \ No newline at end of file