code_junkie

Spring and hibernate.cfg.xml

Nov 13th, 2011
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
  2. <property name="jpaDialect">
  3. <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
  4. </property>
  5. <property name="jpaProperties">
  6. <props>
  7. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
  8. </props>
  9. </property>
  10. </bean>
  11.  
  12. <cache
  13. usage="transactional|read-write|nonstrict-read-write|read-only"
  14. region="RegionName"
  15. include="all|non-lazy"
  16. />
  17.  
  18. <bean
  19. id="mySessionFactory"
  20. class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  21.  
  22. <property name="configLocation">
  23. <value>
  24. classpath:location_of_config_file/hibernate.cfg.xml
  25. </value>
  26. </property>
  27.  
  28. <property name="hibernateProperties">
  29. <props>
  30.  
  31. ...
  32.  
  33.  
  34. </props>
  35. </property>
  36.  
  37. </bean>
Add Comment
Please, Sign In to add comment