Guest User

Untitled

a guest
May 6th, 2014
175
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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:mvc="http://www.springframework.org/schema/mvc"
  5.    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
  6.    xmlns:context="http://www.springframework.org/schema/context"
  7.    xmlns:p="http://www.springframework.org/schema/p"
  8.    xmlns:tx="http://www.springframework.org/schema/tx"
  9.    xmlns:aop="http://www.springframework.org/schema/aop"
  10.    xsi:schemaLocation="
  11.        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
  12.        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  13.        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
  14.        http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
  15.        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
  16.        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
  17.  
  18.     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  19.         <property name="driverClassName" value="org.postgresql.Driver" />
  20.         <property name="url" value="jdbc:postgresql://localhost:5432/mydb" />
  21.         <property name="username" value="postgres" />
  22.         <property name="password" value="postgres" />
  23.     </bean>
  24.    
  25.     <bean id="myEmf" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  26.         <property name="dataSource" ref="dataSource" />
  27.         <property name="packagesToScan" value="com.ss.modelo" />
  28.         <property name="persistenceProviderClass" value="org.hibernate.ejb.HibernatePersistence" />
  29.         <property name="jpaProperties">
  30.             <props>
  31.                 <prop key="hibernate.dialect">
  32.                   org.hibernate.dialect.PostgreSQLDialect
  33.                 </prop>
  34.             </props>
  35.         </property>
  36.     </bean>
  37.    
  38.     <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  39.       <property name="entityManagerFactory" ref="myEmf" />
  40.     </bean>
  41.    
  42.     <tx:annotation-driven/>
  43.    
  44.     <jpa:repositories base-package="com.ss.repositorios"/>
  45.  
  46. </beans>
RAW Paste Data