Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  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:context="http://www.springframework.org/schema/context"
  5. xmlns:tx="http://www.springframework.org/schema/tx"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
  8. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
  9. <context:annotation-config/>
  10.  
  11. <context:component-scan base-package="com.curso.jpa.persistencia"/>
  12. <tx:annotation-driven
  13. transaction-manager="jpaTransactionManager"/>
  14. <bean id="jpaTransactionManager"
  15. class="org.springframework.orm.jpa.JpaTransactionManager">
  16. <property name="entityManagerFactory" ref="entityManagerFactory"/>
  17. </bean>
  18.  
  19. <bean id="entityManagerFactory"
  20. class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  21. <property name="persistenceUnitName" value="SpringJPA"/>
  22. <property name="packagesToScan" value="com.curso.jpa.modelo"/>
  23. <property name="dataSource">
  24. <bean class="org.apache.commons.dbcp.BasicDataSource">
  25. <property name="url" value="jdbc:mysql://localhost:3306/test"/>
  26. <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  27. <property name="username" value="root"/>
  28. <property name="password" value="root"/>
  29. </bean>
  30. </property>
  31. <property name="jpaVendorAdapter">
  32. <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  33. <property name="database" value="MYSQL"/>
  34. <property name="showSql" value="true"/>
  35. </bean>
  36. </property>
  37. <property name="jpaProperties">
  38. <props>
  39. <prop key="hibernate.format_sql">true</prop>
  40. <prop key="hibernate.hbm2ddl.auto">update</prop>
  41. </props>
  42. </property>
  43. </bean>
  44.  
  45. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement