From 6e5e3218cfe1c215d3fdecf5eac13db138da115a Mon Sep 17 00:00:00 2001 From: trang Date: Wed, 31 Jan 2018 16:22:24 +0800 Subject: [PATCH] example --- .../jpa/config/SpringDataSourceConfig.java | 8 +-- .../src/main/resources/application.yml | 68 +------------------ .../src/main/resources/application.yml | 2 + pom.xml | 2 +- 4 files changed, 5 insertions(+), 75 deletions(-) diff --git a/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/java/com/github/trang/druid/example/jpa/config/SpringDataSourceConfig.java b/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/java/com/github/trang/druid/example/jpa/config/SpringDataSourceConfig.java index 9c50a00..4ae98e4 100644 --- a/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/java/com/github/trang/druid/example/jpa/config/SpringDataSourceConfig.java +++ b/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/java/com/github/trang/druid/example/jpa/config/SpringDataSourceConfig.java @@ -17,16 +17,10 @@ import java.util.Map; * @author trang */ @Configuration -@Profile({"dynamic", "dynamic-dev-yaml", "dynamic-dev-props"}) +@Profile("dynamic") @Slf4j public class SpringDataSourceConfig { -// @Bean -// public DruidDataSourceCustomizer druidDataSourceCustomizer() { -// System.out.println("DruidDataSourceCustomizer..."); -// return (dataSource) -> dataSource.setMaxActive(66); -// } - @Bean @Primary public DynamicDataSource dataSource(Map druidDataSourceMap) { diff --git a/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/resources/application.yml b/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/resources/application.yml index 1a97954..778597b 100644 --- a/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/resources/application.yml +++ b/druid-spring-boot-example/druid-spring-boot-jpa-example/src/main/resources/application.yml @@ -86,13 +86,6 @@ spring: debug: true -spring: - profiles: default - ---- - -debug: true - spring: profiles: dynamic autoconfigure: @@ -109,63 +102,4 @@ spring: max-open-prepared-statements: 50 slave: max-active: 25 - max-open-prepared-statements: 25 - ---- - -spring: - profiles: config - datasource: - url: jdbc:h2:file:./samples - username: root - password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg== - schema: classpath:/import.sql - druid: - config: - enabled: true - ---- - -spring: - profiles: features - datasource: - url: jdbc:h2:file:./samples - username: root - password: Biyu5YzU+6sxDRbmWEa3B2uUcImzDo0BuXjTlL505+/pTb+/0Oqd3ou1R6J8+9Fy3CYrM18nBDqf6wAaPgUGOg== - schema: classpath:/import.sql - druid: - # 默认开启,当前已开启 - stat: - log-slow-sql: true - slow-sql-millis: 1000 - # 默认关闭,需手动开启,当前已开启 - slf4j: - enabled: true - connection-log-enabled: false - statement-sql-format-option: - upp-case: true - pretty-format: false - statement-executable-sql-log-enable: true - result-set-log-enabled: false - # 默认关闭,需手动开启,当前已开启 - wall: - enabled: true - log-violation: true - throw-exception: false - config: - delete-where-none-check: true - # 默认关闭,需手动开启,当前已开启 - config: - enabled: true - # 默认关闭,需手动开启,当前已开启 - web-stat: - enabled: true - # 默认关闭,需手动开启,当前已开启 - aop-stat: - enabled: true - patterns: - - com.github.trang.* - # 默认关闭,需手动开启,当前已开启 - stat-view-servlet: - enabled: true - reset-enable: true \ No newline at end of file + max-open-prepared-statements: 25 \ No newline at end of file diff --git a/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml b/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml index 842678d..9cddf05 100644 --- a/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml +++ b/druid-spring-boot-example/druid-spring-boot-mybatis-example/src/main/resources/application.yml @@ -81,6 +81,8 @@ spring: mybatis: type-aliases-package: com.github.trang.druid.example.mybatis.model + configuration: + map-underscore-to-camel-case: true --- diff --git a/pom.xml b/pom.xml index 62431d8..8ebd845 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.github.drtrang parent - 1.0.7 + 1.0.8-SNAPSHOT druid-spring-boot-parent