hint的测试案例
dao-sharding-example有关hint的测试案例
详见dmf-parent项目里的dao-sharding-example子项目
模块 | 场景说明 | 预期结果 | 方法名 | 配置详情 | |
hintManager.add | 分库分表 即addDatabaseShardingValue又addTableShardingValue actual-data-nodes=ds${0..1}.device_$->{0..1} | 执行成功 | TestAHintAddAmoreDbMoreTb | test01 | application_a_hint_add_a_moreDbMoreTb.properties hint算法类: HintDbAlgorithm.java HintTbAlgorithm.java |
1.分库不分表 2.只配置了库规则,没有配置表规则 3.只通过hintManager.addDatabaseShardingValue | 执行成功 | TestAHintAddBmoreDb1Tb | test01 | application_a_hint_add_b_moreDb1Tb.properties hint算法类: HintDbAlgorithm.java | |
1.分库不分表 2.即配置了库规则,又配置表规则 3.通过hintManager.addDatabaseShardingValue 4.通过hintManager.addTableShardingValue | 执行成功 | TestAHintAddCmoreDb1Tb | test01 | application_a_hint_add_c_moreDb1Tb.properties hint算法类: HintDbAlgorithm.java HintTbAlgorithm.java | |
hintManager.set | 1.分库不分表 2.只配置了库规则,没有配置表规则 3.只通过hintManager.setDatabaseShardingValue | 执行成功 | TestAHintAddBmoreDb1Tb | test02 | application_a_hint_add_b_moreDb1Tb.properties hint算法类: HintDbAlgorithm.java |
hint算法传参 | 1.hint算法的shardingValues只传入一个参数 | 执行成功 | TestCHintAlgorithm1Param | test01 | application_c_hint_algorithm_1param.properties hint算法类 HintDbAlgorithm.java HintTbAlgorithm.java |
2.hint算法的shardingValues,可以传入多个参数 | 执行成功 | TestCHintAlgorithmMoreParam | test01 | application_c_hint_algorithm_moreParam.properties hint算法类 HintDbMoreValueAlgorithm HintTbMoreValueAlgorithm HintMoreValueCompare多参数封装类 | |
hint子查询 | 1.分库不分表 2.主表既配置了库规则,又配置了表规则addDatabaseShardingValue和addTableShardingValue 3.子查询的表没有配置任何规则 | 执行成功 | TestDHintSubQueryAddA | test01_selectSubQuery test02_fromSubQuery test03_whereSubQuery | application_d_hint_subquery_add_a.properties hint算法类 HintDbAlgorithm HintTbAlgorithm |
1.分库不分表 2.主表既配置了库规则,无表规则 只通过addDatabaseShardingValue 3.子查询的表没有配置任何规则 | 反案例 执行失败 | TestDHintSubQueryAddB | test01_selectSubQuery test02_fromSubQuery test03_whereSubQuery | application_d_hint_subquery_add_b.properties hint算法类 HintDbAlgorithm HintTbAlgorithm | |
1.分库不分表 2.主表既配置了库规则,无表规则 只通过setDatabaseShardingValue 3.子查询的表没有配置任何规则 | 反案例 执行失败 | test04_selectSubQuery test05_fromSubQuery test06_whereSubQuery | |||
1.分库不分表 2.主表既配置了库规则,又配置了表规则 只通过setDatabaseShardingValue addTableShardingValue 3.子查询的表没有配置任何规则 | 反案例 执行失败 | TestDHintSubQueryAddA | test04_selectSubQuery test05_fromSubQuery test06_whereSubQuery | application_d_hint_subquery_add_a.properties hint算法类 HintDbAlgorithm HintTbAlgorithm |