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

org.appng.testsupport.application-testcontext-jpa.xml Maven / Gradle / Ivy

There is a newer version: 1.24.5
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:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
		http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/tx
		http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context.xsd">

	<bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" depends-on="server">
		<constructor-arg type="java.lang.String" value="jdbc:hsqldb:hsql://localhost:${hsqlPort:9001}/${database:hsql-testdb}" />
		<constructor-arg type="java.lang.String" value="sa" />
		<constructor-arg type="java.lang.String" value="" />
	</bean>

	<tx:annotation-driven transaction-manager="transactionManager" />
	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager" lazy-init="true">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>

	<bean id="server" class="org.appng.testsupport.persistence.HsqlServerFactoryBean" init-method="init"
		destroy-method="destroy">
		<property name="port" value="${hsqlPort:9001}" />
		<property name="databaseName" value="${database:hsql-testdb}" />
	</bean>

	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
		lazy-init="true">
		<property name="persistenceProviderClass" value="org.hibernate.jpa.HibernatePersistenceProvider" />
		<property name="dataSource" ref="datasource" />
		<property name="jpaProperties">
			<props>
				<prop key="hibernate.show_sql">${hibernate.show_sql:false}</prop>
				<prop key="hibernate.format_sql">${hibernate.format_sql:false}</prop>
				<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto:create-drop}</prop>
				<prop key="hibernate.id.new_generator_mappings">false</prop>
			</props>
		</property>
		<property name="packagesToScan">
			<list>
				<value>${entityPackage:}</value>
			</list>
		</property>
	</bean>

	<bean id="entityManager" class="org.springframework.orm.jpa.support.SharedEntityManagerBean" lazy-init="true">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>

</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy