11<beans xmlns =" http://www.springframework.org/schema/beans"
22 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3- xmlns : context =" http://www.springframework.org/schema/context" xmlns : jdbc =" http://www.springframework.org/schema/jdbc"
3+ xmlns : p =" http://www.springframework.org/schema/p"
4+ xmlns : context =" http://www.springframework.org/schema/context"
5+ xmlns : jdbc =" http://www.springframework.org/schema/jdbc"
46 xsi : schemaLocation =" http://www.springframework.org/schema/beans
57 http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd" >
68
79 <context : property-placeholder location =" classpath:db/postgres.properties" system-properties-mode =" OVERRIDE" />
810
9- <context : component-scan base-package =" ru.javawebinar.**.repository.jdbc" />
10-
1111 <jdbc : initialize-database data-source =" dataSource" enabled =" ${database.init}" >
1212 <jdbc : script location =" classpath:db/initDB.sql" />
1313 <jdbc : script location =" classpath:db/populateDB.sql" />
2626 <property name =" password" value =" ${database.password}" />
2727 </bean >
2828
29+ <context : component-scan base-package =" ru.javawebinar.**.repository.jpa" />
30+
31+ <bean id =" entityManagerFactory" class =" org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
32+ p : dataSource-ref =" dataSource"
33+ p : packagesToScan =" ru.gkislin.**.model" >
34+ <!-- p:persistenceUnitName="persistenceUnit">-->
35+
36+ <property name =" jpaPropertyMap" >
37+ <map >
38+ <entry key =" #{T(org.hibernate.cfg.AvailableSettings).FORMAT_SQL}" value =" ${hibernate.format_sql}" />
39+ <entry key =" #{T(org.hibernate.cfg.AvailableSettings).USE_SQL_COMMENTS}"
40+ value =" ${hibernate.use_sql_comments}" />
41+ <!-- <entry key="#{T(org.hibernate.cfg.AvailableSettings).HBM2DDL_AUTO}" value="${hibernate.hbm2ddl.auto}"/>-->
42+ </map >
43+ </property >
44+
45+ <property name =" jpaVendorAdapter" >
46+ <bean class =" org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
47+ p : showSql =" ${jpa.showSql}"
48+ p : databasePlatform =" org.hibernate.dialect.PostgreSQL9Dialect" >
49+ </bean >
50+ </property >
51+ </bean >
52+
53+ <!--
54+ <context:component-scan base-package="ru.javawebinar.**.repository.jdbc"/>
2955 <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
3056 <constructor-arg ref="dataSource"/>
3157 </bean>
3258
3359 <bean id="namedJdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
3460 <constructor-arg ref="dataSource"/>
3561 </bean>
62+ -->
3663</beans >
0 commit comments