File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
mysql-data-generator/src/main/java/com/wuda/tester/mysql Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 44import org .jooq .InsertReturningStep ;
55
66/**
7- * 表示向给定的表插入数据.
7+ * 表示向给定的表插入数据.记录插入数据的量,不是精确值,只是一个估计值.
88 *
99 * @author wuda
1010 */
@@ -14,6 +14,9 @@ public class TableInsertion {
1414 private TableName tableName ;
1515 private InsertReturningStep insertReturningStep ;
1616
17+ /**
18+ * 表中插入的数据量.估计值.
19+ */
1720 private int values ;
1821
1922 /**
@@ -25,6 +28,12 @@ public void incValues(int increment) {
2528 values += increment ;
2629 }
2730
31+ /**
32+ * 构造实例.
33+ *
34+ * @param tableName 表的名称
35+ * @param insertReturningStep 执行insert into的语句
36+ */
2837 public TableInsertion (TableName tableName , InsertReturningStep insertReturningStep ) {
2938 this .tableName = tableName ;
3039 this .insertReturningStep = insertReturningStep ;
Original file line number Diff line number Diff line change @@ -47,22 +47,47 @@ void setCliArgs(CliArgs cliArgs) {
4747 this .cliArgs = cliArgs ;
4848 }
4949
50+ /**
51+ * 随机生成店铺类型.
52+ *
53+ * @return 店铺类型
54+ */
5055 private byte genStoreType () {
5156 return (byte ) RandomUtils .nextInt (1 , 6 );
5257 }
5358
59+ /**
60+ * 随机生成店铺状态
61+ *
62+ * @return 店铺状态
63+ */
5464 private byte genStoreStatus () {
5565 return (byte ) RandomUtils .nextInt (1 , 10 );
5666 }
5767
68+ /**
69+ * 随机生成用户类型.
70+ *
71+ * @return 用户类型
72+ */
5873 private byte genUserType () {
5974 return (byte ) RandomUtils .nextInt (1 , 6 );
6075 }
6176
77+ /**
78+ * 随机生成用户状态
79+ *
80+ * @return 用户状态
81+ */
6282 private byte genUserStatus () {
6383 return (byte ) RandomUtils .nextInt (1 , 10 );
6484 }
6585
86+ /**
87+ * 随机生成物品状态
88+ *
89+ * @return 物品状态
90+ */
6691 private byte genItemStatus () {
6792 return (byte ) RandomUtils .nextInt (1 , 10 );
6893 }
You can’t perform that action at this time.
0 commit comments