Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd">
- <tx:annotation-driven transaction-manager="transactionManager"/>
- <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://127.0.0.1:5432/test" />
- <property name="username" value="postgres" />
- <property name="password" value="postgress" />
- </bean>
- <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource"></property>
- <property name="annotatedClasses">
- <list>
- <value>org.entity.nci.person.Person</value>
- </list>
- </property>
- <property name="hibernateProperties">
- <props>
- <prop
- key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
- <prop key="hibernate.show_sql">true</prop>
- </props>
- </property>
- <property name="packagesToScan" value="com.byteslounge.spring.tx.model" />
- </bean>
- <bean id="transactionManager"
- class="org.springframework.orm.hibernate4.HibernateTransactionManager"
- p:sessionFactory-ref="sessionFactory">
- </bean>
- <tx:advice id="transactionAdvice" transaction-manager="transactionManager">
- <tx:attributes>
- <tx:method name="*"/>
- </tx:attributes>
- </tx:advice>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement