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+ <!-- Directory to scan for repository classes -->
12+ <jpa : repositories base-package =" com.iluwatar" />
13+
14+ <bean id =" dataSource"
15+ class =" org.springframework.jdbc.datasource.DriverManagerDataSource" >
16+ <property name =" driverClassName" >
17+ <value >org.postgresql.Driver</value >
18+ </property >
19+ <property name =" url" >
20+ <value >jdbc:postgresql://localhost:5432/postgres</value >
21+ </property >
22+ <property name =" username" >
23+ <value >postgres</value >
24+ </property >
25+ <property name =" password" >
26+ <value >ile666</value >
27+ </property >
28+ </bean >
29+
30+ <bean id =" entityManagerFactory"
31+ class =" org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
32+ <property name =" dataSource" ref =" dataSource" />
33+ <property name =" persistenceUnitName" value =" jpaData" />
34+ <property name =" jpaVendorAdapter" >
35+ <bean class =" org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
36+ </property >
37+ <property name =" jpaProperties" >
38+ <props >
39+ <prop key =" hibernate.dialect" >org.hibernate.dialect.PostgreSQLDialect</prop >
40+ <prop key =" hibernate.show_sql" >false</prop >
41+ <prop key =" hibernate.format_sql" >false</prop >
42+ <prop key =" hibernate.hbm2ddl.auto" >create</prop >
43+ </props >
44+ </property >
45+ </bean >
46+
47+ <bean id =" transactionManager" class =" org.springframework.orm.jpa.JpaTransactionManager" >
48+ <property name =" entityManagerFactory" ref =" entityManagerFactory" />
49+ </bean >
50+
51+ </beans >
0 commit comments