|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<beans xmlns="http://www.springframework.org/schema/beans" |
| 3 | + xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" |
| 4 | + xmlns:security="http://www.springframework.org/schema/security" |
| 5 | + xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 6 | + xmlns:jpa="http://www.springframework.org/schema/data/jpa" |
| 7 | + xsi:schemaLocation=" |
| 8 | + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd |
| 9 | + http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd"> |
| 10 | + |
| 11 | + <jpa:repositories base-package="com.iluwatar" /> |
| 12 | + |
| 13 | + <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> |
| 14 | + <property name="entityManagerFactory" ref="entityManagerFactory" /> |
| 15 | + </bean> |
| 16 | + |
| 17 | + <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" |
| 18 | + destroy-method="close"> |
| 19 | + <property name="driverClassName" value="org.h2.Driver" /> |
| 20 | + <property name="url" value="jdbc:h2:~/databases/person" /> |
| 21 | + <property name="username" value="sa" /> |
| 22 | + <property name="password" value="sa" /> |
| 23 | + </bean> |
| 24 | + |
| 25 | + <bean id="entityManagerFactory" |
| 26 | + class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> |
| 27 | + <property name="dataSource" ref="dataSource" /> |
| 28 | + <property name="packagesToScan" value="com.iluwatar" /> |
| 29 | + <property name="persistenceProvider"> |
| 30 | + <bean class="org.hibernate.ejb.HibernatePersistence" /> |
| 31 | + </property> |
| 32 | + <property name="jpaProperties"> |
| 33 | + <map> |
| 34 | + <entry key="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" /> |
| 35 | + <entry key="hibernate.hbm2ddl.auto" value="create-drop" /> |
| 36 | + </map> |
| 37 | + </property> |
| 38 | + </bean> |
| 39 | +</beans> |
0 commit comments