|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + xmlns:jdbc="http://www.springframework.org/schema/jdbc" |
| 5 | + xsi:schemaLocation="http://www.springframework.org/schema/jdbc https://www.springframework.org/schema/jdbc/spring-jdbc.xsd |
| 6 | + http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd"> |
| 7 | + |
| 8 | + <import resource="hibernate.xml"/> |
| 9 | + |
| 10 | + <bean id="entityManagerFactory" |
| 11 | + class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 12 | + <property name="dataSource" ref="dataSource"/> |
| 13 | + <property name="persistenceUnitName" value="spring-data-jpa"/> |
| 14 | + <property name="jpaVendorAdapter" ref="vendorAdaptor"/> |
| 15 | + <property name="jpaProperties" ref="jpaProperties"/> |
| 16 | + </bean> |
| 17 | + |
| 18 | + <bean id="abstractVendorAdaptor" abstract="true"> |
| 19 | + <property name="generateDdl" value="true"/> |
| 20 | + <property name="database" value="H2"/> |
| 21 | + </bean> |
| 22 | + |
| 23 | + <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 24 | + <property name="entityManagerFactory" ref="entityManagerFactory"/> |
| 25 | + </bean> |
| 26 | + |
| 27 | + <bean name="sampleEvaluationContextExtension" |
| 28 | + class="org.springframework.data.jpa.repository.sample.SampleEvaluationContextExtension"/> |
| 29 | + |
| 30 | + <jdbc:embedded-database id="dataSource" type="H2" generate-name="true"> |
| 31 | + <jdbc:script execution="INIT" separator="/;" location="classpath:scripts/h2-init.sql"/> |
| 32 | + <jdbc:script execution="INIT" separator="/;" location="classpath:scripts/h2-stored-procedures.sql"/> |
| 33 | + </jdbc:embedded-database> |
| 34 | + |
| 35 | +</beans> |
0 commit comments