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

org.apache.rave.persistence-applicationContext.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<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"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                           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/tx http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

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

    <tx:annotation-driven transaction-manager="transactionManager"/>

    <bean id="entityManagerFactory"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="loadTimeWeaver">
            <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
        </property>
        <property name="persistenceUnitName" value="ravePersistenceUnit"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"
                  p:databasePlatform="${jpa.jpaVendorAdapter.databasePlatform}"
                  p:database="${jpa.jpaVendorAdapter.database}"
                  p:showSql="${jpa.jpaVendorAdapter.showSql}"/>
        </property>
        <property name="jpaDialect">
            <bean class="${jpa.jpaDialect}"/>
        </property>
        <property name="jpaPropertyMap">
            <map>
                <entry key="openjpa.Log" value="${jpa.openjpa.Log}"/>
                <entry key="openjpa.RuntimeUnenhancedClasses" value="${jpa.openjpa.RuntimeUnenhancedClasses}"/>
                <entry key="openjpa.jdbc.SynchronizeMappings" value="${jpa.openjpa.jdbc.SynchronizeMappings}"/>
                <entry key="openjpa.jdbc.MappingDefaults" value="${jpa.openjpa.jdbc.MappingDefaults}"/>
            </map>
        </property>
    </bean>

  <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/${rave.dataSource.name}"/>
    <property name="resourceRef" value="true"/>
  </bean>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy