| 1,3c1,3 |
| < commit 91992382630be957694eb268f219e1ac2f49e568 |
| < Author: Xiaoshuang Li <644968328@qq.com> |
| < Date: Wed Nov 18 17:24:56 2020 +0800 |
| --- |
| > commit 88f6d93b09ec64bbb59f631fe00c1e8b3448c5ff |
| > Author: yu199195 <549477611@qq.com> |
| > Date: Thu Nov 19 14:55:44 2020 +0800 |
| 5,7c5 |
| < Modify the sample (#8205) |
| < |
| < Modify the sample |
| --- |
| > fix spring namespace doc |
| 9,15c7,72 |
| < diff --git a/docs/document/content/features/sharding/concept/inline-expression.cn.md b/docs/document/content/features/sharding/concept/inline-expression.cn.md |
| < index aef4796b7d..8c53c1b2f9 100644 |
| < --- a/docs/document/content/features/sharding/concept/inline-expression.cn.md |
| < +++ b/docs/document/content/features/sharding/concept/inline-expression.cn.md |
| < @@ -142,7 +142,7 @@ db${0..1}.t_order_0${0..9}, db${0..1}.t_order_${10..20} |
| < 或者 |
| < |
| --- |
| > diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md |
| > index 4eddf149aa..0ed852f1d8 100644 |
| > --- a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md |
| > +++ b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.cn.md |
| > @@ -43,32 +43,48 @@ weight = 4 |
| > |
| > <!-- 配置分库策略 --> |
| > <sharding:sharding-algorithm id="dbShardingAlgorithm" type="INLINE"> |
| > - <properties> |
| > + <props> |
| > <prop key="algorithm-expression">ds$->{user_id % 2}</prop> |
| > - </properties> |
| > + </props> |
| > </sharding:sharding-algorithm> |
| > <sharding:standard-strategy id="dbStrategy" sharding-column="user_id" algorithm-ref="dbShardingAlgorithm" /> |
| > |
| > <!-- 配置分表策略 --> |
| > <sharding:sharding-algorithm id="tableShardingAlgorithm" type="INLINE"> |
| > - <properties> |
| > + <props> |
| > <prop key="algorithm-expression">t_order$->{order_id % 2}</prop> |
| > - </properties> |
| > + </props> |
| > </sharding:sharding-algorithm> |
| > <sharding:standard-strategy id="tableStrategy" sharding-column="user_id" algorithm-ref="tableShardingAlgorithm" /> |
| > + |
| > + <!-- 配置分布式id生成策略 --> |
| > + <sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE"> |
| > + <props> |
| > + <prop key="worker-id">123</prop> |
| > + </props> |
| > + </sharding:key-generate-algorithm> |
| > + <sharding:key-generate-strategy id="orderKeyGenerator" column="order_id" algorithm-ref="snowflakeAlgorithm" /> |
| > + |
| > + <!-- 配置sharding策略 --> |
| > + <sharding:rule id="shardingRule"> |
| > + <sharding:table-rules> |
| > + <sharding:table-rule logic-table="t_order" actual-data-nodes="ds${0..1}.t_order_${0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" key-generate-strategy-ref="orderKeyGenerator" /> |
| > + </sharding:table-rules> |
| > + <sharding:binding-table-rules> |
| > + <sharding:binding-table-rule logic-tables="t_order,t_order_item"/> |
| > + </sharding:binding-table-rules> |
| > + <sharding:broadcast-table-rules> |
| > + <sharding:broadcast-table-rule table="t_address"/> |
| > + </sharding:broadcast-table-rules> |
| > + </sharding:rule> |
| > |
| > <!-- 配置ShardingSphereDataSource --> |
| > - <sharding:data-source id="shardingDataSource"> |
| > - <!-- 配置分片规则 --> |
| > - <sharding:sharding-rule data-source-names="ds0,ds1"> |
| > - <sharding:table-rules> |
| > - <!-- 配置 t_order 表规则 --> |
| > - <sharding:table-rule logic-table="t_order" actual-data-nodes="ds$->{0..1}.t_order$->{0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" /> |
| > - <!-- 省略配置 t_order_item 表规则... --> |
| > - <!-- ... --> |
| > - </sharding:table-rules> |
| > - </sharding:sharding-rule> |
| > - </sharding:data-source> |
| > + <shardingsphere:data-source id="shardingDataSource" data-source-names="ds0, ds1" rule-refs="shardingRule"> |
| > + <props> |
| > + <prop key="sql-show">false</prop> |
| > + </props> |
| > + </shardingsphere:data-source> |
| > + |
| > </beans> |
| 17,18c74,144 |
| < -db->${0..1}.t_order_0$->{0..9}, db$->{0..1}.t_order_$->{10..20} |
| < +db$->{0..1}.t_order_0$->{0..9}, db$->{0..1}.t_order_$->{10..20} |
| --- |
| > |
| > diff --git a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md |
| > index 3b8ce4dec3..65b2ce8ff9 100644 |
| > --- a/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md |
| > +++ b/docs/document/content/user-manual/shardingsphere-jdbc/usage/sharding/spring-namespace.en.md |
| > @@ -43,32 +43,48 @@ weight = 4 |
| > |
| > <!-- Configure database sharding strategy --> |
| > <sharding:sharding-algorithm id="dbShardingAlgorithm" type="INLINE"> |
| > - <properties> |
| > - <prop key="algorithm-expression">ds$->{user_id % 2}</prop> |
| > - </properties> |
| > + <props> |
| > + <prop key="algorithm-expression">ds$->{user_id % 2}</prop> |
| > + </props> |
| > </sharding:sharding-algorithm> |
| > <sharding:standard-strategy id="dbStrategy" sharding-column="user_id" algorithm-ref="dbShardingAlgorithm" /> |
| > - |
| > + |
| > <!-- Configure table sharding strategy --> |
| > <sharding:sharding-algorithm id="tableShardingAlgorithm" type="INLINE"> |
| > - <properties> |
| > - <prop key="algorithm-expression">t_order$->{order_id % 2}</prop> |
| > - </properties> |
| > + <props> |
| > + <prop key="algorithm-expression">t_order$->{order_id % 2}</prop> |
| > + </props> |
| > </sharding:sharding-algorithm> |
| > <sharding:standard-strategy id="tableStrategy" sharding-column="user_id" algorithm-ref="tableShardingAlgorithm" /> |
| > - |
| > + |
| > + <!-- Configure distributed key-generate strategy --> |
| > + <sharding:key-generate-algorithm id="snowflakeAlgorithm" type="SNOWFLAKE"> |
| > + <props> |
| > + <prop key="worker-id">123</prop> |
| > + </props> |
| > + </sharding:key-generate-algorithm> |
| > + <sharding:key-generate-strategy id="orderKeyGenerator" column="order_id" algorithm-ref="snowflakeAlgorithm" /> |
| > + |
| > + <!-- Configure sharding rule --> |
| > + <sharding:rule id="shardingRule"> |
| > + <sharding:table-rules> |
| > + <sharding:table-rule logic-table="t_order" actual-data-nodes="ds${0..1}.t_order_${0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" key-generate-strategy-ref="orderKeyGenerator" /> |
| > + </sharding:table-rules> |
| > + <sharding:binding-table-rules> |
| > + <sharding:binding-table-rule logic-tables="t_order,t_order_item"/> |
| > + </sharding:binding-table-rules> |
| > + <sharding:broadcast-table-rules> |
| > + <sharding:broadcast-table-rule table="t_address"/> |
| > + </sharding:broadcast-table-rules> |
| > + </sharding:rule> |
| > + |
| > <!-- Configure ShardingSphereDataSource --> |
| > - <sharding:data-source id="shardingDataSource"> |
| > - <!-- Configure sharding rule --> |
| > - <sharding:sharding-rule data-source-names="ds0,ds1"> |
| > - <sharding:table-rules> |
| > - <!-- Configure t_order table rule --> |
| > - <sharding:table-rule logic-table="t_order" actual-data-nodes="ds$->{0..1}.t_order$->{0..1}" database-strategy-ref="dbStrategy" table-strategy-ref="tableStrategy" /> |
| > - <!-- Omit t_order_item table rule configuration ... --> |
| > - <!-- ... --> |
| > - </sharding:table-rules> |
| > - </sharding:sharding-rule> |
| > - </sharding:data-source> |
| > + <shardingsphere:data-source id="shardingDataSource" data-source-names="ds0,ds1" rule-refs="shardingRule"> |
| > + <props> |
| > + <prop key="sql-show">false</prop> |
| > + </props> |
| > + </shardingsphere:data-source> |
| > + |
| > </beans> |
| 21d146 |
| < ## 配置分片算法 |