81,122
社区成员




<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean name="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean name="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<aop:config>
<aop:pointcut id="defaultServiceOperation"
expression="execution(* service.*.*(..))"
/>
<aop:advisor pointcut-ref="defaultServiceOperation"
advice-ref="txAdvice" />
</aop:config>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="get*" read-only="true" />
<tx:method name="find*" read-only="true" />
<tx:method name="login*" read-only="true" />
<tx:method name="*" />
</tx:attributes>
</tx:advice>
<bean id="loginDao" class="Dao.LoginDao">
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>
<bean id="loginServer" class="service.LoginService">
<property name="loginDao" ref="loginDao" />
</bean>
<bean id="wentedDao" class="Dao.WantedDao">
<property name="hibernateTemplate" ref="hibernateTemplate" />
</bean>
<bean id="wantedServices" class="service.WantedService">
<property name="wentedDao" ref="wentedDao" />
</bean>
</beans>