All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ommons-util.commons-util-core-bc-composite-security.3.19.source-code.local-jpa-infrastructure-configuration.xml Maven / Gradle / Ivy

There is a newer version: 3.24
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2010 Västra Götalandsregionen

      This library is free software; you can redistribute it and/or modify
      it under the terms of version 2.1 of the GNU Lesser General Public
      License as published by the Free Software Foundation.

      This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU Lesser General Public License for more details.

      You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the
      Free Software Foundation, Inc., 59 Temple Place, Suite 330,
      Boston, MA 02111-1307  USA


-->

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

    <context:annotation-config/>
    <tx:annotation-driven/>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitManager" ref="pum"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaVendorAdapter" ref="hibernateJpaVendor"/>
        <property name="jpaProperties">
            <props>
                <prop key="hibernate.show_sql">${hibernate.database.showsql}</prop>
                <prop key="hibernate.format_sql">${hibernate.database.showsql}</prop>
            </props>
        </property>
    </bean>

    <bean id="hibernateJpaVendor" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        <property name="generateDdl" value="${hibernate.vendor.generateDdl}"/>
        <property name="databasePlatform" value="${hibernate.vendor.databasePlatform}"/>
        <property name="database" value="${hibernate.vendor.database}"/>
    </bean>

    <bean id="pum" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
        <property name="persistenceXmlLocations">
            <list>
                <value>classpath*:META-INF/*-persistence.xml</value>
            </list>
        </property>
        <property name="persistenceUnitPostProcessors">
            <bean class="se.vgregion.dao.infrastructure.persistence.jpa.MergingPersistenceUnitPostProcessor"/>
        </property>
        <property name="defaultDataSource" ref="dataSource"/>
    </bean>

    <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/PortalDbPool"/>
    </bean>

</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy