Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
9300dd2a
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9300dd2a
编写于
9月 29, 2017
作者:
H
haocao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor sharding-jdbc-spring-boot-example.
上级
688e4757
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
99 addition
and
33 deletion
+99
-33
sharding-jdbc-spring-boot-example/pom.xml
sharding-jdbc-spring-boot-example/pom.xml
+5
-0
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-jpa-example/pom.xml
...xample/sharding-jdbc-spring-boot-data-jpa-example/pom.xml
+0
-5
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-jpa-example/src/main/resources/application.properties
...ata-jpa-example/src/main/resources/application.properties
+1
-2
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-masterslave.properties
...ple/src/main/resources/application-masterslave.properties
+24
-0
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-sharding-db.properties
...ple/src/main/resources/application-sharding-db.properties
+22
-0
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-sharding-tbl.properties
...le/src/main/resources/application-sharding-tbl.properties
+17
-0
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-sharding.properties
...xample/src/main/resources/application-sharding.properties
+26
-0
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application.properties
...mybatis-example/src/main/resources/application.properties
+4
-26
未找到文件。
sharding-jdbc-spring-boot-example/pom.xml
浏览文件 @
9300dd2a
...
...
@@ -20,5 +20,10 @@
<artifactId>
sharding-jdbc-spring-boot-starter
</artifactId>
<version>
${sharding-jdbc.version}
</version>
</dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<artifactId>
HikariCP-java7
</artifactId>
<version>
${hikari-cp.version}
</version>
</dependency>
</dependencies>
</project>
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-jpa-example/pom.xml
浏览文件 @
9300dd2a
...
...
@@ -13,10 +13,5 @@
<artifactId>
spring-boot-starter-data-jpa
</artifactId>
<version>
${spring-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.zaxxer
</groupId>
<artifactId>
HikariCP-java7
</artifactId>
<version>
${hikari-cp.version}
</version>
</dependency>
</dependencies>
</project>
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-jpa-example/src/main/resources/application.properties
浏览文件 @
9300dd2a
...
...
@@ -2,8 +2,7 @@ spring.jpa.properties.hibernate.hbm2ddl.auto=create
spring.jpa.properties.hibernate.dialect
=
org.hibernate.dialect.MySQL5Dialect
#spring.jpa.properties.hibernate.show_sql=true
#
spring.profiles.active=sharding
spring.profiles.active
=
sharding
#spring.profiles.active=sharding-db
#spring.profiles.active=sharding-tbl
#spring.profiles.active=masterslave
spring.profiles.active
=
sharding-masterslave
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-masterslave.properties
0 → 100644
浏览文件 @
9300dd2a
sharding.jdbc.datasource.names
=
ds_master,ds_slave_0,ds_slave_1
sharding.jdbc.datasource.ds_master.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_master.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_master.url
=
jdbc:mysql://localhost:3306/demo_ds_master
sharding.jdbc.datasource.ds_master.username
=
root
sharding.jdbc.datasource.ds_master.password
=
sharding.jdbc.datasource.ds_slave_0.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_slave_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_slave_0.url
=
jdbc:mysql://localhost:3306/demo_ds_slave_0
sharding.jdbc.datasource.ds_slave_0.username
=
root
sharding.jdbc.datasource.ds_slave_0.password
=
sharding.jdbc.datasource.ds_slave_1.type
=
com.zaxxer.hikari.HikariDataSource
sharding.jdbc.datasource.ds_slave_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_slave_1.url
=
jdbc:mysql://localhost:3306/demo_ds_slave_1
sharding.jdbc.datasource.ds_slave_1.username
=
root
sharding.jdbc.datasource.ds_slave_1.password
=
sharding.jdbc.config.masterslave.load-balance-algorithm-type
=
round_robin
sharding.jdbc.config.masterslave.name
=
ds_ms
sharding.jdbc.config.masterslave.masterDataSourceName
=
ds_master
sharding.jdbc.config.masterslave.slaveDataSourceNames
=
ds_slave_0,ds_slave_1
\ No newline at end of file
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-sharding-db.properties
0 → 100644
浏览文件 @
9300dd2a
sharding.jdbc.datasource.names
=
ds_0,ds_1
sharding.jdbc.datasource.ds_0.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_0.url
=
jdbc:mysql://localhost:3306/demo_ds_0
sharding.jdbc.datasource.ds_0.username
=
root
sharding.jdbc.datasource.ds_0.password
=
sharding.jdbc.datasource.ds_1.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_1.url
=
jdbc:mysql://localhost:3306/demo_ds_1
sharding.jdbc.datasource.ds_1.username
=
root
sharding.jdbc.datasource.ds_1.password
=
sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column
=
user_id
sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-inline-expression
=
ds_${user_id % 2}
sharding.jdbc.config.sharding.tables.t_order.actualDataNodes
=
ds_${0..1}.t_order
sharding.jdbc.config.sharding.tables.t_order.keyGeneratorColumnName
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.actualDataNodes
=
ds_${0..1}.t_order_item
sharding.jdbc.config.sharding.tables.t_order_item.keyGeneratorColumnName
=
order_item_id
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-sharding-tbl.properties
0 → 100644
浏览文件 @
9300dd2a
sharding.jdbc.datasource.names
=
ds
sharding.jdbc.datasource.ds.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds.url
=
jdbc:mysql://localhost:3306/demo_ds
sharding.jdbc.datasource.ds.username
=
root
sharding.jdbc.datasource.ds.password
=
sharding.jdbc.config.sharding.tables.t_order.actualDataNodes
=
ds.t_order_${0..1}
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.shardingColumn
=
order_id
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.algorithmInlineExpression
=
t_order_${order_id % 2}
sharding.jdbc.config.sharding.tables.t_order.keyGeneratorColumnName
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.actualDataNodes
=
ds.t_order_item_${0..1}
sharding.jdbc.config.sharding.tables.t_order_item.tableStrategy.inline.shardingColumn
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.tableStrategy.inline.algorithmInlineExpression
=
t_order_item_${order_id % 2}
sharding.jdbc.config.sharding.tables.t_order_item.keyGeneratorColumnName
=
order_item_id
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application-sharding.properties
0 → 100644
浏览文件 @
9300dd2a
sharding.jdbc.datasource.names
=
ds_0,ds_1
sharding.jdbc.datasource.ds_0.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_0.url
=
jdbc:mysql://localhost:3306/demo_ds_0
sharding.jdbc.datasource.ds_0.username
=
root
sharding.jdbc.datasource.ds_0.password
=
sharding.jdbc.datasource.ds_1.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_1.url
=
jdbc:mysql://localhost:3306/demo_ds_1
sharding.jdbc.datasource.ds_1.username
=
root
sharding.jdbc.datasource.ds_1.password
=
sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column
=
user_id
sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-inline-expression
=
ds_${user_id % 2}
sharding.jdbc.config.sharding.tables.t_order.actualDataNodes
=
ds_${0..1}.t_order_${0..1}
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.shardingColumn
=
order_id
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.algorithmInlineExpression
=
t_order_${order_id % 2}
sharding.jdbc.config.sharding.tables.t_order.keyGeneratorColumnName
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.actualDataNodes
=
ds_${0..1}.t_order_item_${0..1}
sharding.jdbc.config.sharding.tables.t_order_item.tableStrategy.inline.shardingColumn
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.tableStrategy.inline.algorithmInlineExpression
=
t_order_item_${order_id % 2}
sharding.jdbc.config.sharding.tables.t_order_item.keyGeneratorColumnName
=
order_item_id
sharding-jdbc-spring-boot-example/sharding-jdbc-spring-boot-data-mybatis-example/src/main/resources/application.properties
浏览文件 @
9300dd2a
mybatis.config-location
=
classpath:META-INF/mybatis-config.xml
sharding.jdbc.datasource.names
=
ds_0,ds_1
sharding.jdbc.datasource.ds_0.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_0.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_0.url
=
jdbc:mysql://localhost:3306/demo_ds_0
sharding.jdbc.datasource.ds_0.username
=
root
sharding.jdbc.datasource.ds_0.password
=
sharding.jdbc.datasource.ds_1.type
=
org.apache.commons.dbcp.BasicDataSource
sharding.jdbc.datasource.ds_1.driver-class-name
=
com.mysql.jdbc.Driver
sharding.jdbc.datasource.ds_1.url
=
jdbc:mysql://localhost:3306/demo_ds_1
sharding.jdbc.datasource.ds_1.username
=
root
sharding.jdbc.datasource.ds_1.password
=
sharding.jdbc.config.sharding.default-database-strategy.inline.sharding-column
=
user_id
sharding.jdbc.config.sharding.default-database-strategy.inline.algorithm-inline-expression
=
ds_${user_id % 2}
sharding.jdbc.config.sharding.tables.t_order.actualDataNodes
=
ds_${0..1}.t_order_${0..1}
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.shardingColumn
=
order_id
sharding.jdbc.config.sharding.tables.t_order.tableStrategy.inline.algorithmInlineExpression
=
t_order_${order_id % 2}
sharding.jdbc.config.sharding.tables.t_order.keyGeneratorColumnName
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.actualDataNodes
=
ds_${0..1}.t_order_item_${0..1}
sharding.jdbc.config.sharding.tables.t_order_item.tableStrategy.inline.shardingColumn
=
order_id
sharding.jdbc.config.sharding.tables.t_order_item.tableStrategy.inline.algorithmInlineExpression
=
t_order_item_${order_id % 2}
sharding.jdbc.config.sharding.tables.t_order_item.keyGeneratorColumnName
=
order_item_id
spring.profiles.active
=
sharding
#spring.profiles.active=sharding-db
#spring.profiles.active=sharding-tbl
#spring.profiles.active=masterslave
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录