<bean id="dataSource" class="com.wormpex.fd.wddl.group.support.GroupDataSource">
<constructor-arg name="dataSourceKey" value="inf_pay_center_man"/> <!-- 这里需要填写数据库名称,不需要用配置文件了,dev/beta/prod数据库名称必须保持一致 -->
</bean>
<!--第二套数据源-->
<bean id="dataSourceBank" class="com.wormpex.fd.wddl.group.support.GroupDataSource">
<constructor-arg name="dataSourceKey" value="pay_center_bank_info"/> <!-- 这里需要填写数据库名称,不需要用配置文件了,dev/beta/prod数据库名称必须保持一致 -->
</bean>
<!--<bean id="transactionManager" class="com.wormpex.inf.wmq.tx.WTransactionManager">-->
<!--<constructor-arg name="dataSource" ref="dataSource"/>-->
<!--</bean>-->
<!--<tx:annotation-driven transaction-manager="transactionManager"/>-->
<!--<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">-->
<!--<constructor-arg name="dataSource" ref="dataSource"/>-->
<!--</bean>-->
<!--<tx:annotation-driven transaction-manager="transactionManager"/>-->
<!-- 创建SqlSessionFactory -->
<bean id="sqlSessionFactory" name="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml"/>
<property name="mapperLocations" value="classpath*:mappers/*.xml"/>
<!--<property name="typeAliasesPackage" value="com.wormpex.cvs.userbalance.service"/>-->
</bean>
<bean id="sqlSessionBankFactory" name="sqlSessionBankFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSourceBank"/>
<property name="configLocation" value="classpath:bankMybatis/mybatis-config.xml"/>
<property name="mapperLocations" value="classpath*:bankMappers/*.xml"/>
<!--<property name="typeAliasesPackage" value="com.wormpex.cvs.userbalance.service"/>-->
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.wormpex.paycenter.man.service.dao"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.wormpex.paycenter.man.service.bankDao"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionBankFactory"/>
</bean>
网友评论