mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 06:58:54 +00:00
63 lines
3.1 KiB
XML
63 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
|
|
The MIT License
|
|
Copyright © 2014-2019 Ilkka Seppälä
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
|
|
-->
|
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
xmlns:security="http://www.springframework.org/schema/security" xmlns:tx="http://www.springframework.org/schema/tx"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
|
|
|
|
<jpa:repositories base-package="com.iluwatar"
|
|
base-class="org.springframework.data.jpa.repository.support.SimpleJpaRepository" />
|
|
|
|
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
|
|
<property name="entityManagerFactory" ref="entityManagerFactory" />
|
|
</bean>
|
|
|
|
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
|
|
destroy-method="close">
|
|
<property name="driverClassName" value="org.h2.Driver" />
|
|
<property name="url" value="jdbc:h2:~/databases/person" />
|
|
<property name="username" value="sa" />
|
|
<property name="password" value="sa" />
|
|
</bean>
|
|
|
|
<bean id="entityManagerFactory"
|
|
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
|
|
<property name="dataSource" ref="dataSource" />
|
|
<property name="packagesToScan" value="com.iluwatar" />
|
|
<property name="persistenceProvider">
|
|
<bean class="org.hibernate.jpa.HibernatePersistenceProvider" />
|
|
</property>
|
|
<property name="jpaProperties">
|
|
<map>
|
|
<entry key="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
|
|
<entry key="hibernate.hbm2ddl.auto" value="create" />
|
|
<entry key="hibernate.show_sql" value="false" />
|
|
</map>
|
|
</property>
|
|
</bean>
|
|
</beans>
|