Citation:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!-- Application context DAO layer -->
<beans>
<!-- General -->
<bean id="article" class="ma.tpmichemin.dao.Article.ArticleDao">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="marque" class="ma.tpmichemin.dao.Marque.MarqueDao">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="mappingResources">
<list>
<value>ma/tpmichemin/_model/Article.hbm.xml</value>
<value>ma/tpmichemin/_model/Marque.hbm.xml</value>
</list>
</property>
</bean>
<!-- Gestion des transactions -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="transactionProxy" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<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="*">PROPAGATION_REQUIRED, readOnly</prop>
</props>
</property>
</bean>
</beans>
Citation:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="IArticleManagerTarget" class="ma.tpmichemin.metier.Article.ArticleManager">
<property name="article">
<ref bean="article" />
</property>
</bean>
<bean id="IArticleManager" parent="transactionProxy">
<property name="target">
<ref bean="IArticleManagerTarget"/>
</property>
<property name="transactionAttributeSource">
<bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>
</property>
</bean>
<bean id="IMarqueManagerTarget" class="ma.tpmichemin.metier.Marque.MarqueManager">
<property name="marque">
<ref bean="marque" />
</property>
</bean>
<bean id="IMarqueManager" parent="transactionProxy">
<property name="target">
<ref bean="IMarqueManagerTarget"/>
</property>
<property name="transactionAttributeSource">
<bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>
</property>
</bean>
</beans>
Merci d'avance pour votre aide :)