Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
threezhang authored Jul 14, 2016
1 parent 812f2b2 commit 274af60
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions tsharding-client/README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
交易分库分表组件TSharding
## 交易分库分表组件TSharding


### 关键类
* 1.测试用例入口 com.mogujie.service.tsharding.test#TShardingTest

####
1.测试用例入口 com.mogujie.service.tsharding.test#TShardingTest
* 2.默认走Master库的前缀命名 com.mogujie.trade.tsharding.route.orm.base.ReadWriteSplittingContextInitializer.DEFAULT_WRITE_METHOD_NAMES

2.默认走Master库的前缀命名 com.mogujie.trade.tsharding.route.orm.base.ReadWriteSplittingContextInitializer.DEFAULT_WRITE_METHOD_NAMES
* 3.SQL增强 com.mogujie.trade.tsharding.route.orm.MapperResourceEnhancer.enhancedShardingSQL

3.SQL增强 com.mogujie.trade.tsharding.route.orm.MapperResourceEnhancer.enhancedShardingSQL


####测试用例
### 测试用例

跑测试用例之前先建库建表结构;
理论上是8个库,512张表,每个库64张表.

如果仅仅是跑测试用例,执行下面的sql就可以跑通:

create database trade0000;
create database trade0001;
create database trade0002;
create database trade0003;
create database trade0004;
create database trade0005;
create database trade0006;
create database trade0007;

create database trade;

use trade0001;
CREATE TABLE `TradeOrder0064` (
`orderId` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',
`buyerUserId` bigint(20) unsigned NOT NULL COMMENT '买家的userId',
`sellerUserId` bigint(20) unsigned NOT NULL COMMENT '卖家的userId',
`shipTime` int(11) unsigned DEFAULT '0' COMMENT '发货时间',
PRIMARY KEY (`orderId`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8mb4 COMMENT='订单信息表';

INSERT INTO `TradeOrder0064` (`orderId`, `buyerUserId`, `sellerUserId`, `shipTime`)
VALUES
(50000280834672, 1234567, 2345678, 12345678);
create database trade0000;
create database trade0001;
create database trade0002;
create database trade0003;
create database trade0004;
create database trade0005;
create database trade0006;
create database trade0007;
create database trade;
use trade0001;

CREATE TABLE `TradeOrder0064` (
`orderId` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单ID',
`buyerUserId` bigint(20) unsigned NOT NULL COMMENT '买家的userId',
`sellerUserId` bigint(20) unsigned NOT NULL COMMENT '卖家的userId',
`shipTime` int(11) unsigned DEFAULT '0' COMMENT '发货时间',
PRIMARY KEY (`orderId`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8mb4 COMMENT='订单信息表';

INSERT INTO `TradeOrder0064` (`orderId`, `buyerUserId`, `sellerUserId`, `shipTime`)
VALUES
(50000280834672, 1234567, 2345678, 12345678);

0 comments on commit 274af60

Please sign in to comment.