Advertisement
Guest User

Untitled

a guest
Oct 5th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 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" xmlns:tx="http://www.springframework.org/schema/tx"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  6.  
  7. <context:component-scan base-package="com.aimprosoft.learning"/>
  8.  
  9. <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  10. <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  11. <property name="url" value="jdbc:mysql://localhost:3306/develop?&amp;serverTimezone=UTC&amp;useSSL=false&amp;characterEncoding=utf8"/>
  12. <property name="username" value="developer"/>
  13. <property name="password" value="developer"/>
  14. </bean>
  15.  
  16. <bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
  17. <property name="dataSource" ref="dataSource"/>
  18. <property name="configLocation" value="classpath:hibernate.cfg.xml"/>
  19. <property name="packagesToScan" value="com.aimprosoft.learning.database.model"/>
  20. </bean>
  21.  
  22. <bean id="transactionManager"
  23. class="org.springframework.orm.hibernate5.HibernateTransactionManager">
  24. <property name="sessionFactory" ref="sessionFactory"/>
  25. </bean>
  26.  
  27. <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
  28. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement