1:<?xml version="1.0" encoding="UTF-8"?> 2: 3:<!-- 4: Document : applicationContext.xml 5: Created on : March 14, 2006, 7:04 PM 6: Author : mklaene 7: Description: 8: Application context used for Spring IOC. 9:--> 10: 11:<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> 12:<beans> 13: 14: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 15: <property name="driverClassName"> 16: <value>org.hsqldb.jdbcDriver</value> 17: </property> 18: <property name="url"> 19: <value>jdbc:hsqldb:hsql://localhost:9002</value> 20: </property> 21: <property name="username"> 22: <value>sa</value> 23: </property> 24: <property name="password"> 25: <value></value> 26: </property> 27: </bean> 28: 29: <!-- Hibernate SessionFactory --> 30: <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> 31: <property name="dataSource"> 32: <ref local="dataSource"/> 33: </property> 34: <property name="mappingResources"> 35: <list> 36: <value>hotelReservations/domain/Room.hbm.xml</value> 37: </list> 38: </property> 39: <property name="hibernateProperties"> 40: <props> 41: <prop key="hibernate.dialect"> net.sf.hibernate.dialect.HSQLDialect </prop> 42: </props> 43: </property> 44: </bean> 45: 46: <!-- Hibernate transaction manager--> 47: <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"> 48: <property name="sessionFactory"> 49: <ref local="sessionFactory"/> 50: </property> 51: </bean> 52: 53: <!--Dao (Data Access Object) for application. --> 54: <bean id="roomDAO" class="hotelReservations.dao.RoomDaoHibernate"> 55: <property name="sessionFactory"> 56: <ref local="sessionFactory"/> 57: </property> 58: </bean> 59: 60: <!--Manager for Hotel rooms application.--> 61: <bean id="hotelManager" class="hotelReservations.HotelManager"> 62: <property name="roomDAO"> 63: <ref local="roomDAO"/> 64: </property> 65: </bean> 66: 67: <!--Wraps manager in order to support transactions.--> 68: <bean id="manager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> 69: <property name="transactionManager"> 70: <ref local="transactionManager"/> 71: </property> 72: <property name="target"> 73: <ref local="hotelManager"/> 74: </property> 75: <property name="transactionAttributes"> 76: <props> 77: <prop key="save*">PROPAGATION_REQUIRED</prop> 78: <prop key="remove*">PROPAGATION_REQUIRED</prop> 79: <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> 80: </props> 81: </property> 82: </bean> 83: 84:</beans>