Loading README.md +3 −3 Original line number Diff line number Diff line Loading @@ -181,15 +181,15 @@ try ( <property name="password" value=""/> </bean> <rdb:strategy id="orderTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_${order_id % 4}"/> <rdb:strategy id="orderItemTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_item_${order_id % 4}"/> <rdb:strategy id="orderTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_${order_id.longValue() % 4}"/> <rdb:strategy id="orderItemTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_item_${order_id.longValue() % 4}"/> <rdb:data-source id="shardingDataSource"> <rdb:sharding-rule data-sources="dbtbl_0,dbtbl_1"> <rdb:table-rules> <rdb:table-rule logic-table="t_order" actual-tables="t_order_${0..3}" table-strategy="orderTableStrategy"/> <rdb:table-rule logic-table="t_order_item" actual-tables="t_order_item_${0..3}" table-strategy="orderItemTableStrategy"/> </rdb:table-rules> <rdb:default-database-strategy sharding-columns="user_id" algorithm-expression="dbtbl_${user_id % 2 + 1}"/> <rdb:default-database-strategy sharding-columns="user_id" algorithm-expression="dbtbl_${user_id.longValue() % 2 + 1}"/> </rdb:sharding-rule> </rdb:data-source> </beans> Loading Loading
README.md +3 −3 Original line number Diff line number Diff line Loading @@ -181,15 +181,15 @@ try ( <property name="password" value=""/> </bean> <rdb:strategy id="orderTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_${order_id % 4}"/> <rdb:strategy id="orderItemTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_item_${order_id % 4}"/> <rdb:strategy id="orderTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_${order_id.longValue() % 4}"/> <rdb:strategy id="orderItemTableStrategy" sharding-columns="order_id" algorithm-expression="t_order_item_${order_id.longValue() % 4}"/> <rdb:data-source id="shardingDataSource"> <rdb:sharding-rule data-sources="dbtbl_0,dbtbl_1"> <rdb:table-rules> <rdb:table-rule logic-table="t_order" actual-tables="t_order_${0..3}" table-strategy="orderTableStrategy"/> <rdb:table-rule logic-table="t_order_item" actual-tables="t_order_item_${0..3}" table-strategy="orderItemTableStrategy"/> </rdb:table-rules> <rdb:default-database-strategy sharding-columns="user_id" algorithm-expression="dbtbl_${user_id % 2 + 1}"/> <rdb:default-database-strategy sharding-columns="user_id" algorithm-expression="dbtbl_${user_id.longValue() % 2 + 1}"/> </rdb:sharding-rule> </rdb:data-source> </beans> Loading