Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?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:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       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="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
      <list>
        <value>classpath:application.properties</value>
        <value>classpath:security.properties</value>
      </list>
    </property>
  </bean>

  <bean name="userSiteCredentialRepository"
        class="se.vgregion.portal.cs.domain.persistence.jpa.JpaUserSiteCredentialRepository">
  </bean>

  <bean name="jpaSiteKeyRepository"
        class="se.vgregion.portal.cs.domain.persistence.jpa.JpaSiteKeyRepository">
  </bean>

  <bean name="migrationService" class="se.vgregion.portal.cs.service.MigrationServiceImpl" />

  <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.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="${database.driver}"/>
    <property name="url" value="${database.url}"/>
    <property name="username" value="${database.user}"/>
    <property name="password" value="${database.password}"/>
  </bean>

</beans>
New to GrepCode? Check out our FAQ X