Commit 5d56ffd9 authored by terrymanu's avatar terrymanu
Browse files

fix spring-namespace-example

parent 2267ae35
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@
        <property name="password" value=""/>
    </bean>
    
    <bean id="randomStrategy" class="io.shardingsphere.core.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm" />
    <bean id="randomStrategy" class="io.shardingsphere.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm" />
    
    <master-slave:data-source id="masterSlaveDataSource" master-data-source-name="demo_ds_master" slave-data-source-names="demo_ds_slave_0, demo_ds_slave_1" strategy-ref="randomStrategy" />
</beans>
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@
        <property name="maxActive" value="16"/>
    </bean>
    
    <bean id="randomStrategy" class="io.shardingsphere.core.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm" />
    <bean id="randomStrategy" class="io.shardingsphere.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm" />
    

    <sharding:inline-strategy id="databaseStrategy" sharding-column="user_id" algorithm-expression="demo_ds_ms_${user_id % 2}" />
+4 −4
Original line number Diff line number Diff line
@@ -16,10 +16,10 @@
    <import resource="classpath*:META-INF/orche/etcd/regCenter.xml" />
    <context:component-scan base-package="io.shardingsphere.example.spring.namespace.jpa"/>
    
    <orchestration:sharding-data-source id="shardingTableDataSource" registry-center-ref="regCenter" />
    <orchestration:sharding-data-source id="shardingTablesDataSource" registry-center-ref="regCenter" />
    
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="shardingTableDataSource" />
        <property name="dataSource" ref="shardingTablesDataSource" />
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" p:database="MYSQL" />
        </property>
+1 −2
Original line number Diff line number Diff line
@@ -57,9 +57,8 @@
        <property name="password" value=""/>
    </bean>
    
    <bean id="randomStrategy" class="io.shardingsphere.core.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm" />
    <bean id="randomStrategy" class="io.shardingsphere.api.algorithm.masterslave.RandomMasterSlaveLoadBalanceAlgorithm" />
    
    <master-slave:data-source id="realMasterSlaveDataSource" master-data-source-name="demo_ds_master" slave-data-source-names="demo_ds_slave_0, demo_ds_slave_1" strategy-ref="randomStrategy" />

    <orchestraion:master-slave-data-source id="masterSlaveDataSource"  data-source-ref="realMasterSlaveDataSource" registry-center-ref="regCenter" overwrite="true" />
</beans>
+0 −2
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@
    <bean id="preciseModuloDatabaseShardingAlgorithm" class="io.shardingsphere.example.spring.namespace.jpa.fixture.algorithm.PreciseModuloDatabaseShardingAlgorithm" />
    
    <sharding:standard-strategy id="databaseShardingStrategy" sharding-column="user_id" precise-algorithm-ref="preciseModuloDatabaseShardingAlgorithm" />
    
    <sharding:data-source id="realShardingDatabasesDataSource">
        <sharding:sharding-rule data-source-names="demo_ds_0, demo_ds_1">
            <sharding:table-rules>
@@ -62,6 +61,5 @@
            </sharding:table-rules>
        </sharding:sharding-rule>
    </sharding:data-source>

    <orchestraion:sharding-data-source id="shardingDatabasesDataSource" data-source-ref="realShardingDatabasesDataSource" registry-center-ref="regCenter" overwrite="true" />
</beans>
Loading