Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
656cc34f
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,发现更多精彩内容 >>
提交
656cc34f
编写于
9月 22, 2017
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix test case for jdbc
上级
83b6cde5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
15 addition
and
17 deletion
+15
-17
sharding-jdbc-orchestration-example/src/main/java/io/shardingjdbc/example/orchestration/Main.java
...main/java/io/shardingjdbc/example/orchestration/Main.java
+2
-2
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingAndMasterSlaveMain.java
...c/example/jdbc/RawJdbcJavaShardingAndMasterSlaveMain.java
+2
-2
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingDatabaseAndTableMain.java
...example/jdbc/RawJdbcJavaShardingDatabaseAndTableMain.java
+2
-2
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingDatabaseOnlyMain.java
...dbc/example/jdbc/RawJdbcJavaShardingDatabaseOnlyMain.java
+0
-2
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingTableOnlyMain.java
...ngjdbc/example/jdbc/RawJdbcJavaShardingTableOnlyMain.java
+2
-2
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-yaml-example/src/main/resources/META-INF/withAssignedDataSource.yaml
...e/src/main/resources/META-INF/withAssignedDataSource.yaml
+3
-3
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-yaml-example/src/main/resources/META-INF/withDefaultDataSource.yaml
...le/src/main/resources/META-INF/withDefaultDataSource.yaml
+2
-2
sharding-jdbc-transaction-example/src/main/java/io/shardingjdbc/example/transaction/Main.java
...c/main/java/io/shardingjdbc/example/transaction/Main.java
+2
-2
未找到文件。
sharding-jdbc-orchestration-example/src/main/java/io/shardingjdbc/example/orchestration/Main.java
浏览文件 @
656cc34f
...
...
@@ -86,11 +86,11 @@ public final class Main {
ShardingRuleConfiguration
result
=
new
ShardingRuleConfiguration
();
TableRuleConfiguration
orderTableRuleConfig
=
new
TableRuleConfiguration
();
orderTableRuleConfig
.
setLogicTable
(
"t_order"
);
orderTableRuleConfig
.
setActual
Tables
(
"t_order_${[0, 1]
}"
);
orderTableRuleConfig
.
setActual
DataNodes
(
"ds_jdbc_${0..1}.t_order_${0..1
}"
);
result
.
getTableRuleConfigs
().
add
(
orderTableRuleConfig
);
TableRuleConfiguration
orderItemTableRuleConfig
=
new
TableRuleConfiguration
();
orderItemTableRuleConfig
.
setLogicTable
(
"t_order_item"
);
orderItemTableRuleConfig
.
setActual
Tables
(
"t_order_item_${[0, 1]
}"
);
orderItemTableRuleConfig
.
setActual
DataNodes
(
"ds_jdbc_${0..1}.t_order_item_${0..1
}"
);
result
.
getTableRuleConfigs
().
add
(
orderItemTableRuleConfig
);
result
.
getBindingTableGroups
().
add
(
"t_order, t_order_item"
);
result
.
setDefaultDatabaseShardingStrategyConfig
(
new
InlineShardingStrategyConfiguration
(
"user_id"
,
"ds_jdbc_${user_id % 2}"
));
...
...
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingAndMasterSlaveMain.java
浏览文件 @
656cc34f
...
...
@@ -57,7 +57,7 @@ public final class RawJdbcJavaShardingAndMasterSlaveMain {
private
static
TableRuleConfiguration
getOrderTableRuleConfiguration
()
{
TableRuleConfiguration
orderTableRuleConfig
=
new
TableRuleConfiguration
();
orderTableRuleConfig
.
setLogicTable
(
"t_order"
);
orderTableRuleConfig
.
setActual
Tables
(
"
t_order_${[0, 1]}"
);
orderTableRuleConfig
.
setActual
DataNodes
(
"ds_${0..1}.
t_order_${[0, 1]}"
);
orderTableRuleConfig
.
setKeyGeneratorColumnName
(
"order_id"
);
return
orderTableRuleConfig
;
}
...
...
@@ -65,7 +65,7 @@ public final class RawJdbcJavaShardingAndMasterSlaveMain {
private
static
TableRuleConfiguration
getOrderItemTableRuleConfiguration
()
{
TableRuleConfiguration
orderItemTableRuleConfig
=
new
TableRuleConfiguration
();
orderItemTableRuleConfig
.
setLogicTable
(
"t_order_item"
);
orderItemTableRuleConfig
.
setActual
Tables
(
"
t_order_item_${[0, 1]}"
);
orderItemTableRuleConfig
.
setActual
DataNodes
(
"ds_${0..1}.
t_order_item_${[0, 1]}"
);
return
orderItemTableRuleConfig
;
}
...
...
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingDatabaseAndTableMain.java
浏览文件 @
656cc34f
...
...
@@ -52,7 +52,7 @@ public final class RawJdbcJavaShardingDatabaseAndTableMain {
private
static
TableRuleConfiguration
getOrderTableRuleConfiguration
()
{
TableRuleConfiguration
orderTableRuleConfig
=
new
TableRuleConfiguration
();
orderTableRuleConfig
.
setLogicTable
(
"t_order"
);
orderTableRuleConfig
.
setActual
Tables
(
"
t_order_${[0, 1]}"
);
orderTableRuleConfig
.
setActual
DataNodes
(
"ds_jdbc_${0..1}.
t_order_${[0, 1]}"
);
orderTableRuleConfig
.
setKeyGeneratorColumnName
(
"order_id"
);
return
orderTableRuleConfig
;
}
...
...
@@ -60,7 +60,7 @@ public final class RawJdbcJavaShardingDatabaseAndTableMain {
private
static
TableRuleConfiguration
getOrderItemTableRuleConfiguration
()
{
TableRuleConfiguration
orderItemTableRuleConfig
=
new
TableRuleConfiguration
();
orderItemTableRuleConfig
.
setLogicTable
(
"t_order_item"
);
orderItemTableRuleConfig
.
setActual
Tables
(
"
t_order_item_${[0, 1]}"
);
orderItemTableRuleConfig
.
setActual
DataNodes
(
"ds_jdbc_${0..1}.
t_order_item_${[0, 1]}"
);
return
orderItemTableRuleConfig
;
}
...
...
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingDatabaseOnlyMain.java
浏览文件 @
656cc34f
...
...
@@ -48,7 +48,6 @@ public final class RawJdbcJavaShardingDatabaseOnlyMain {
private
static
TableRuleConfiguration
getOrderTableRuleConfiguration
()
{
TableRuleConfiguration
orderTableRuleConfig
=
new
TableRuleConfiguration
();
orderTableRuleConfig
.
setLogicTable
(
"t_order"
);
orderTableRuleConfig
.
setActualTables
(
"t_order"
);
orderTableRuleConfig
.
setKeyGeneratorColumnName
(
"order_id"
);
return
orderTableRuleConfig
;
}
...
...
@@ -56,7 +55,6 @@ public final class RawJdbcJavaShardingDatabaseOnlyMain {
private
static
TableRuleConfiguration
getOrderItemTableRuleConfiguration
()
{
TableRuleConfiguration
orderItemTableRuleConfig
=
new
TableRuleConfiguration
();
orderItemTableRuleConfig
.
setLogicTable
(
"t_order_item"
);
orderItemTableRuleConfig
.
setActualTables
(
"t_order_item"
);
return
orderItemTableRuleConfig
;
}
...
...
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-java-example/src/main/java/io/shardingjdbc/example/jdbc/RawJdbcJavaShardingTableOnlyMain.java
浏览文件 @
656cc34f
...
...
@@ -47,7 +47,7 @@ public final class RawJdbcJavaShardingTableOnlyMain {
private
static
TableRuleConfiguration
getOrderTableRuleConfiguration
()
{
TableRuleConfiguration
orderTableRuleConfig
=
new
TableRuleConfiguration
();
orderTableRuleConfig
.
setLogicTable
(
"t_order"
);
orderTableRuleConfig
.
setActual
Tables
(
"
t_order_${[0, 1]}"
);
orderTableRuleConfig
.
setActual
DataNodes
(
"ds_jdbc.
t_order_${[0, 1]}"
);
orderTableRuleConfig
.
setKeyGeneratorColumnName
(
"order_id"
);
return
orderTableRuleConfig
;
}
...
...
@@ -55,7 +55,7 @@ public final class RawJdbcJavaShardingTableOnlyMain {
private
static
TableRuleConfiguration
getOrderItemTableRuleConfiguration
()
{
TableRuleConfiguration
orderItemTableRuleConfig
=
new
TableRuleConfiguration
();
orderItemTableRuleConfig
.
setLogicTable
(
"t_order_item"
);
orderItemTableRuleConfig
.
setActual
Tables
(
"
t_order_item_${[0, 1]}"
);
orderItemTableRuleConfig
.
setActual
DataNodes
(
"ds_jdbc.
t_order_item_${[0, 1]}"
);
return
orderItemTableRuleConfig
;
}
...
...
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-yaml-example/src/main/resources/META-INF/withAssignedDataSource.yaml
浏览文件 @
656cc34f
...
...
@@ -19,17 +19,17 @@ defaultKeyGeneratorClass: io.shardingjdbc.core.keygen.DefaultKeyGenerator
tables
:
t_config
:
actual
Tabl
es
:
ds_config.t_config
actual
DataNod
es
:
ds_config.t_config
t_order
:
actual
Tabl
es
:
ds_${0..1}.t_order_${0..1}
actual
DataNod
es
:
ds_${0..1}.t_order_${0..1}
tableStrategy
:
inline
:
shardingColumn
:
order_id
algorithmInlineExpression
:
t_order_${order_id % 2}
keyGeneratorColumnName
:
order_id
t_order_item
:
actual
Tabl
es
:
ds_${0..1}.t_order_item_${0..1}
actual
DataNod
es
:
ds_${0..1}.t_order_item_${0..1}
#绑定表中其余的表的策略与第一张表的策略相同
tableStrategy
:
inline
:
...
...
sharding-jdbc-raw-jdbc-example/sharding-jdbc-raw-jdbc-yaml-example/src/main/resources/META-INF/withDefaultDataSource.yaml
浏览文件 @
656cc34f
...
...
@@ -12,14 +12,14 @@ dataSources:
tables
:
t_order
:
actual
Tables
:
t_order_${0..1}
actual
DataNodes
:
ds_${0..1}.
t_order_${0..1}
tableStrategy
:
inline
:
shardingColumn
:
order_id
algorithmInlineExpression
:
t_order_${order_id % 2}
t_order_item
:
actual
Tables
:
t_order_item_${0..1}
actual
DataNodes
:
ds_${0..1}.
t_order_item_${0..1}
#绑定表中其余的表的策略与第一张表的策略相同
tableStrategy
:
inline
:
...
...
sharding-jdbc-transaction-example/src/main/java/io/shardingjdbc/example/transaction/Main.java
浏览文件 @
656cc34f
...
...
@@ -78,12 +78,12 @@ public final class Main {
ShardingRuleConfiguration
shardingRuleConfig
=
new
ShardingRuleConfiguration
();
TableRuleConfiguration
orderTableRuleConfig
=
new
TableRuleConfiguration
();
orderTableRuleConfig
.
setLogicTable
(
"t_order"
);
orderTableRuleConfig
.
setActual
Tables
(
"t_order_0, t_order_1
"
);
orderTableRuleConfig
.
setActual
DataNodes
(
"ds_trans_${0..1}.t_order_${0..1}
"
);
shardingRuleConfig
.
getTableRuleConfigs
().
add
(
orderTableRuleConfig
);
TableRuleConfiguration
orderItemTableRuleConfig
=
new
TableRuleConfiguration
();
orderItemTableRuleConfig
.
setLogicTable
(
"t_order_item"
);
orderItemTableRuleConfig
.
setActual
Tables
(
"t_order_item_0, t_order_item_1
"
);
orderItemTableRuleConfig
.
setActual
DataNodes
(
"ds_trans_${0..1}.t_order_item_${0..1}
"
);
shardingRuleConfig
.
getTableRuleConfigs
().
add
(
orderItemTableRuleConfig
);
shardingRuleConfig
.
getBindingTableGroups
().
add
(
"t_order, t_order_item"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录