Guest User

Untitled

a guest
Nov 21st, 2016
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 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:p="http://www.springframework.org/schema/p"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:jpa="http://www.springframework.org/schema/data/jpa"
  8. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  9. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  10. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  11. http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
  12.  
  13. <!-- Data source -->
  14. <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
  15. p:driverClass="org.h2.Driver"
  16. p:jdbcUrl="jdbc:h2:tcp://localhost/D:/tmp/h2test"
  17. p:user="sa"
  18. p:password=""
  19. p:minPoolSize="2"
  20. p:maxPoolSize="100" />
  21.  
  22. <!-- EntityManagerFactory -->
  23. <bean id="organizrEMF" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  24. <property name="dataSource" ref="dataSource" />
  25. <property name="packagesToScan" value="pk.organizr" />
  26. <property name="jpaVendorAdapter">
  27. <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
  28. </property>
  29. <property name="jpaProperties">
  30. <props>
  31. <prop key="hibernate.archive.autodetection">class</prop>
  32. <prop key="hibernate.show_sql">true</prop>
  33. <prop key="hibernate.format_sql">true</prop>
  34. <prop key="use_sql_comments">true</prop>
  35. <prop key="hibernate.dialect">org.hibernate.dialect.H2Dialect</prop>
  36. </props>
  37. </property>
  38. </bean>
  39.  
  40.  
  41. <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
  42. <property name="entityManagerFactory" ref="organizrEMF" />
  43. </bean>
  44.  
  45. <tx:annotation-driven transaction-manager="transactionManager"/>
  46.  
  47. <bean id="persistenceExceptionTranslationPostProcessor"
  48. class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
  49.  
  50. <!-- Enable JPA Repositories -->
  51. <jpa:repositories base-package="pk.organizr" entity-manager-factory-ref="organizrEMF">
  52. </jpa:repositories>
  53.  
  54. <jpa:auditing set-dates="true" />
  55.  
  56. </beans>
Add Comment
Please, Sign In to add comment