All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.2.3.2.source-code.spring-test.xml Maven / Gradle / Ivy

There is a newer version: 2.4.1
Show newest version
<?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:context="http://www.springframework.org/schema/context" 
	xmlns:tx="http://www.springframework.org/schema/tx"
	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-3.0.xsd
     http://www.springframework.org/schema/aop 
     http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

	<context:component-scan base-package="tools.xor" />

	<bean id="propertyConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<list>
				<value>cfg-test.properties</value>
			</list>
		</property>
	</bean>

	<!-- DataSource -->
	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName" value="${test.connection.driverClass}" />
		<property name="url" value="${test.connection.url}" />
		<property name="username" value="${test.connection.userName}" />
		<property name="password" value="${test.connection.password}" />
	</bean>

	<!-- Hibernate -->
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="packagesToScan" value="tools.xor.db" />	
		<property name="hibernateProperties">
			<props>

				<prop key="hibernate.dialect">${test.hibernate.dialect}</prop>
				<prop key="hibernate.show_sql">${test.hibernate.showSql}</prop>
				<prop key="hibernate.hbm2ddl.auto">${test.hibernate.hbm2ddlAuto}</prop>
				<prop key="hibernate.max_fetch_depth">0</prop>
				<!-- Disable outer join fetching -->				
			</props>
		</property>
	</bean>

	<!-- Transaction management -->
	<bean id="transactionManager"
		class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

	<!-- enable the configuration of transactional behavior based on annotations -->
	<tx:annotation-driven transaction-manager="transactionManager"/>	

	<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy