File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
ddal-example/ddal-example-example0/src/main
java/org/hellojavaer/ddal/example/example0/dao/impl Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 2020import org .hellojavaer .ddal .sequence .Sequence ;
2121import org .mybatis .spring .SqlSessionTemplate ;
2222import org .springframework .beans .factory .annotation .Autowired ;
23- import org .springframework .beans .factory .annotation .Value ;
2423import org .springframework .stereotype .Repository ;
2524
2625import java .util .List ;
@@ -36,7 +35,7 @@ public class UserDaoImpl implements UserDao {
3635 @ Autowired
3736 private SqlSessionTemplate sqlSessionTemplate ;
3837
39- @ Value ( "#{dataSource.sequence}" )
38+ @ Autowired
4039 private Sequence sequence ;
4140
4241 @ Override
Original file line number Diff line number Diff line change 1616 <bean name =" dataSource" class =" org.hellojavaer.ddal.datasource.DefaultDDALDataSource" >
1717 <constructor-arg index =" 0" value =" jdbc:ddal:thick:classpath:/datasource.xml" />
1818 </bean >
19+ <bean id =" sequence" class =" org.springframework.aop.framework.ProxyFactoryBean" >
20+ <property name =" proxyInterfaces" >
21+ <value >org.hellojavaer.ddal.sequence.Sequence</value >
22+ </property >
23+ <property name =" target" value =" #{dataSource.sequence}" />
24+ </bean >
25+ <bean id =" shardRouter" class =" org.springframework.aop.framework.ProxyFactoryBean" >
26+ <property name =" proxyInterfaces" >
27+ <value >org.hellojavaer.ddal.ddr.shard.ShardRouter</value >
28+ </property >
29+ <property name =" target" value =" #{dataSource.shardRouter}" />
30+ </bean >
1931
2032 <bean id =" txManager" class =" org.springframework.jdbc.datasource.DataSourceTransactionManager" >
2133 <property name =" defaultTimeout" value =" 6000" />
You can’t perform that action at this time.
0 commit comments