Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 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:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xsi:schemaLocation="
  8. http://www.springframework.org/schema/beans
  9. http://www.springframework.org/schema/beans/spring-beans.xsd
  10. http://www.springframework.org/schema/tx
  11. http://www.springframework.org/schema/tx/spring-tx.xsd
  12. http://www.springframework.org/schema/aop
  13. http://www.springframework.org/schema/aop/spring-aop.xsd
  14. http://www.springframework.org/schema/context
  15. http://www.springframework.org/schema/context/spring-context.xsd">
  16.  
  17. <context:annotation-config></context:annotation-config>
  18. <context:component-scan
  19. base-package="net.tecgurus"></context:component-scan>
  20.  
  21. <!-- Definicion del datasource -->
  22. <!-- HikariCP configuration -->
  23.  
  24. <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource"
  25. destroy-method="close">
  26. <property name="driverClassName"
  27. value="com.mysql.jdbc.Driver" />
  28. <property name="jdbcUrl"
  29. value="jdbc:mysql://localhost:3306/tec_gurus" />
  30. <property name="username" value="root" />
  31. <property name="password" value="root" />
  32. </bean>
  33.  
  34. <bean id="sessionFactory"
  35. class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
  36. <property name="dataSource" ref="dataSource" />
  37. <property name="packagesToScan"
  38. value="net.tecgurus.persistence.entities" />
  39. <property name="hibernateProperties">
  40. <props>
  41. <prop key="hibernate.dialect">
  42. org.hibernate.dialect.MySQLDialect
  43. </prop>
  44. </props>
  45. </property>
  46. </bean>
  47.  
  48. <bean id="transactionManager"
  49. class="org.springframework.orm.hibernate5.HibernateTransactionManager">
  50. <property name="sessionFactory" ref="sessionFactory"/>
  51. </bean>
  52.  
  53. <tx:annotation-driven transaction-manager="transactionManager" />
  54.  
  55. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement