Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.34 KB | None | 0 0
  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:context="http://www.springframework.org/schema/context"
  5.       xmlns:p="http://www.springframework.org/schema/p"
  6.       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  7.                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
  8.       default-autowire="byName">
  9.  
  10.         <context:property-placeholder location="classpath:test-config.properties" />
  11.  
  12.         <bean id="dataSource"
  13.                class="org.springframework.jdbc.datasource.DriverManagerDataSource"
  14.                p:driverClassName="${dataSource.driverClassName}" p:url="${dataSource.url}"
  15.                p:username="${dataSource.username}" p:password="${dataSource.password}" />
  16.  
  17.         <bean id="pum"
  18.                class="org.paloma.switching.bo.CustomPersistenceUnitManager">
  19.                 <property name="persistenceXmlLocations">
  20.                         <list>
  21.                                
  22.                                 <value>classpath*:META-INF/persistence-switching.xml</value>
  23.                                 <value>classpath*:META-INF/wallet-persistence.xml</value>                              
  24.                         </list>
  25.                 </property>
  26.                 <property name="persistenceUnitPostProcessors">
  27.                         <bean class="org.jleaf.core.orm.jpa.MergingPersistenceUnitPostProcessor" />
  28.                 </property>
  29.         </bean>
  30.         <bean
  31.                class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
  32.                id="entityManagerFactory" p:dataSource-ref="dataSource">
  33.                 <property name="persistenceUnitManager" ref="pum" />
  34.                
  35.                
  36.                 <property name="jpaVendorAdapter">
  37.                         <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
  38.                                p:database="POSTGRESQL"
  39.                                p:showSql="true"
  40.                                p:generateDdl="false" />
  41.                 </property>
  42.                 <property name="jpaProperties">
  43.                    <props>
  44.                     <prop key="hibernate.hbm2ddl">validate</prop>
  45.                     <prop key="hibernate.connection.driver_class">${dataSource.driverClassName}</prop>
  46.                         <prop key="hibernate.connection.username">${dataSource.username}</prop>
  47.                         <prop key="hibernate.connection.password">${dataSource.password}</prop>
  48.                         <prop key="hibernate.connection.url">${dataSource.url}</prop>
  49.                    </props>
  50.                 </property>
  51.                  
  52.         </bean>
  53.  
  54.         <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  55.                 <property name="entityManagerFactory" ref="entityManagerFactory" />
  56.                 <property name="dataSource" ref="dataSource" />
  57.         </bean>
  58.        
  59.         <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  60.                 <property name="dataSource" ref="dataSource" />
  61.         </bean>
  62. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement