coderMmw commented on issue #5208:
URL: https://github.com/apache/shardingsphere/issues/5208#issuecomment-616366192


   xml info
   `<sharding:standard-strategy id="orderTableStrategy" 
sharding-column="order_id" 
precise-algorithm-ref="singleKeyHashShardingAlgorithm1" />
        <sharding:standard-strategy id="userTableStrategy" 
sharding-column="user_account" 
precise-algorithm-ref="singleKeyHashShardingAlgorithm1" />
        <sharding:standard-strategy id="macTableStrategy" sharding-column="mac" 
precise-algorithm-ref="singleKeyHashShardingAlgorithm1" />
        <sharding:standard-strategy id="macPointRecordStrategy" 
sharding-column="mac" precise-algorithm-ref="singleKeyHashShardingAlgorithm1" />
        <sharding:standard-strategy id="userPointRecordStrategy" 
sharding-column="user_account" 
precise-algorithm-ref="singleKeyHashShardingAlgorithm1" />
        <sharding:standard-strategy id="userCopyTableStrategy" 
sharding-column="user_account" 
precise-algorithm-ref="singleKeyHashShardingAlgorithm1" />
   <sharding:data-source id="shardingDataSource">
                <sharding:sharding-rule 
data-source-names="defaultDataSource,readDataSource">
                        <sharding:master-slave-rules>
                                <sharding:master-slave-rule  
id="defaultDataSource0" master-data-source-name="defaultDataSource" 
slave-data-source-names="readDataSource"  />
   
                        </sharding:master-slave-rules>
                        <sharding:table-rules>
   
                                <sharding:table-rule logic-table="ucm_order"
                                                                         
actual-data-nodes="defaultDataSource0.ucm_order_${0..9}" 
table-strategy-ref="orderTableStrategy"   />
                                <sharding:table-rule 
logic-table="ucm_subscriber"
                                                                         
actual-data-nodes="defaultDataSource0.ucm_subscriber_${0..9}" 
table-strategy-ref="userTableStrategy" />
                                <sharding:table-rule logic-table="ucm_mac_goods"
                                                                         
actual-data-nodes="defaultDataSource0.ucm_mac_goods_${0..9}"      
table-strategy-ref="macTableStrategy" />
                                <sharding:table-rule 
logic-table="ucm_mac_points_record"
                                                                         
actual-data-nodes="defaultDataSource0.ucm_mac_points_record_${0..9}"      
table-strategy-ref="macPointRecordStrategy" />
                                <sharding:table-rule 
logic-table="ucm_user_points_income_record"
                                                                         
actual-data-nodes="defaultDataSource0.ucm_user_points_income_record_${0..9}"    
table-strategy-ref="userPointRecordStrategy" />
   
                                <sharding:table-rule 
logic-table="ucm_user_copy1"
                                                                         
actual-data-nodes="defaultDataSource0.ucm_user_copy1_${0..9}"    
table-strategy-ref="userCopyTableStrategy" />
                        </sharding:table-rules>
                        <!--<sharding:binding-table-rules>-->
                                <!--<sharding:binding-table-rule 
logic-tables="ucm_order,ucm_subscriber,ucm_mac_goods,ucm_mac_points_record,ucm_user_points_income_record"/>-->
                        <!--</sharding:binding-table-rules>-->
                        <!--<sharding:broadcast-table-rules>-->
                                <!--<sharding:broadcast-table-rule 
table="t_address"/>-->
                        <!--</sharding:broadcast-table-rules>-->
                </sharding:sharding-rule>
   
                <sharding:props>
                        <prop key="sql.show">false</prop>
                </sharding:props>
   
        </sharding:data-source>
        <bean id="sqlSessionFactory" 
class="org.mybatis.spring.SqlSessionFactoryBean">
                <property name="dataSource" ref="shardingDataSource" />
                <!-- 自动扫描mapping.xml文件 -->
                <property name="mapperLocations" 
value="classpath:mapper/*.Mapper.xml"></property>
                <property name="configLocation" 
value="classpath:config/mybatis-config.xml" />
        </bean>
   
   
        <!-- (事务管理)transaction manager, use JtaTransactionManager for global tx 
-->
        <bean id="transactionManager"
                
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
                <property name="dataSource" ref="shardingDataSource" />
        </bean>`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to