1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <bean id="OrderService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref local="TransactionManager"></ref> </property> <property name="target"> <bean class="com.ibatis.jpetstore.service.OrderService"> <property name="itemDao"> <ref bean="ItemDao"/> </property> <property name="orderDao"> <ref bean="OrderDao"/> </property> <property name="sequenceDao"> <ref bean="SequenceDao"/> </property> </bean> </property> <property name="transactionAttributes"> <props> <prop key="insert*">ROPAGATION_REQUIRED</prop> </props> </property> </bean> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | public class OrderService { /* Private Fields */ private ItemDao itemDao; private OrderDao orderDao; private SequenceDao sequenceDao; /* Constructors */ public OrderService() { } /** * @param itemDao 要设置的 itemDao。 */ public final void setItemDao(ItemDao itemDao) { this.itemDao = itemDao; } /** * @param orderDao 要设置的 orderDao。 */ public final void setOrderDao(OrderDao orderDao) { this.orderDao = orderDao; } /** * @param sequenceDao 要设置的 sequenceDao。 */ public final void setSequenceDao(SequenceDao sequenceDao) { this.sequenceDao = sequenceDao; } // 剩下的部分 …… . } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |