<?xml version="1.0"?>
<!DOCTYPE beans PUBLIC
                "-//SPRING//DTD BEAN//EN"
                "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

	<bean id="urlMapping"
		class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />

	<bean id="viewResolver"
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<property name="prefix">
			<value>/WEB-INF/jsp/</value>
		</property>
		<property name="suffix">
			<value>.jsp</value>
		</property>
	</bean>

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName" value="org.postgresql.Driver" />
		<property name="url" value="jdbc:postgresql://localhost:5432/test" />
		<property name="username" value="cysun" />
		<property name="password" value="abcd" />
		<property name="initialSize" value="1" />
		<property name="maxActive" value="50" />
		<property name="maxIdle" value="1" />
	</bean>

	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="configLocation" value="classpath:/hibernate.cfg.xml" />
	</bean>

	<bean id="transactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

	<bean id="transactionAttributeSource"
		class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
		<property name="properties">
			<props>
				<prop key="add*">PROPAGATION_REQUIRED</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>
			</props>
		</property>
	</bean>

	<bean id="employeeDao"
		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
		lazy-init="true">
		<property name="transactionManager" ref="transactionManager" />
		<property name="transactionAttributeSource" ref="transactionAttributeSource" />
		<property name="target">
			<bean class="hello.model.dao.hibernate.EmployeeDaoImpl">
				<property name="sessionFactory" ref="sessionFactory" />
			</bean>
		</property>
	</bean>

	<bean name="/hello.html" class="hello.spring.controller.HelloController">
		<property name="employeeDao" ref="employeeDao" />
	</bean>

</beans>
