package com.prs.application.ehld.biz.service;
public interface BaseService ...{
![]()
}
package com.prs.application.ehld.sample.biz.service;
public interface SampleService extends BaseService ...{
public void setUserInfoDAO(UserInfoDAO userInfoDAO);
public void insertUserInfo(UserInfoDTO userInfo) throws BusinessServiceException;
}
<!—定义拦截器-->
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="find*">PROPAGATION_SUPPORTS,readOnly</prop>
<prop key="get*">PROPAGATION_SUPPORTS,readOnly</prop>
<prop key="*">PROPAGATION_SUPPORTS,readOnly</prop>
</props>
</property>
</bean>
<!—定义类型自动代理创建器-->
<bean id="autoClassTypeProxyCreator"
class="com.prs.application.ehld.common.aotoproxy.BeanClassTypeAutoProxyCreator">
<property name="interceptorNames">
<value>transactionInterceptor</value>
</property>
<property name="classTypes">
<list>
<value>com.prs.application.ehld.biz.service.BaseService</value>
</list>
</property>
</bean>
<!—定义事务bean-->
<bean id="com.prs.application.ehld.sample.biz.service.sampleService"
class="com.prs.application.ehld.sample.biz.service.impl.SampleServiceImpl">
<property name="userInfoDAO"
ref="com.prs.application.ehld.sample.integration.dao.userInfoDAO">
</property>
</bean>