Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:jpa="http://www.springframework.org/schema/data/jpa"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:jee="http://www.springframework.org/schema/jee"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
- http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
- http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd">
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="org.postgresql.Driver" />
- <property name="url" value="jdbc:postgresql://localhost:5432/testapplicationDB" />
- <property name="username" value="root" />
- <property name="password" value="root" />
- </bean>
- <!-- Configure the data source bean -->
- <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/CustomerSupport"/>
- <!-- Create default configuration for Hibernate -->
- <bean id="hibernateJpaVendorAdapter"
- class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
- <!-- Configure the entity manager factory bean -->
- <bean id="entityManagerFactory"
- class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
- <property name="dataSource" ref="dataSource"/>
- <property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
- <!-- Set JPA properties -->
- <property name="jpaProperties">
- <props>
- <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
- <prop key="javax.persistence.schema-generation.database.action">none</prop>
- <prop key="hibernate.ejb.use_class_enhancer">true</prop>
- </props>
- </property>
- <!-- Set base package of your entities -->
- <property name="packagesToScan" value="com.testapp.model"/>
- <!-- Set share cache mode -->
- <property name="sharedCacheMode" value="ENABLE_SELECTIVE"/>
- <!-- Set validation mode -->
- <property name="validationMode" value="NONE"/>
- </bean>
- <!-- Configure the transaction manager bean -->
- <bean id="transactionManager"
- class="org.springframework.orm.jpa.JpaTransactionManager">
- <property name="entityManagerFactory" ref="entityManagerFactory"/>
- </bean>
- <!-- Enable annotation driven transaction management -->
- <tx:annotation-driven/>
- <!--
- Configure Spring Data JPA and set the base package of the
- repository interfaces
- -->
- <jpa:repositories base-package="com.testapp.repository"/>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement