关于S2SH的一些重要的配置
<!-- 定义hibernateTemplate -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- 声明一个 Hibernate 3 的事务管理器供代理类自动管理事务用 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!--定义sjzdflDAO代理对象-->
<!--这个地方我举得一个例子,sjzdflDAO是一个例子,Proxy是代理-->
<bean id="SjzdflDAOProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref bean="SjzdflDAO" />
</property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<!-- DAO -->
<!--定义sjzdflDAO-->
<bean id="SjzdflDAO" class="com.ibeifeng.dao.SjzdflDAOImpl">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate" />
</property>
</bean>
<!-- Service -->
<!-- 定义sjzdflService -->
<bean id="SjzdflService" class="com.ibeifeng.service.SjzdflServiceImpl">
<property name="sjzdflDAO">
<ref bean="SjzdflDAOProxy" />
</property>
</bean>