Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xsi:schemaLocation="
- http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/tx
- http://www.springframework.org/schema/tx/spring-tx.xsd
- http://www.springframework.org/schema/aop
- http://www.springframework.org/schema/aop/spring-aop.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context.xsd">
- <context:annotation-config></context:annotation-config>
- <context:component-scan
- base-package="net.tecgurus"></context:component-scan>
- <!-- Definicion del datasource -->
- <!-- HikariCP configuration -->
- <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource"
- destroy-method="close">
- <property name="driverClassName"
- value="com.mysql.jdbc.Driver" />
- <property name="jdbcUrl"
- value="jdbc:mysql://localhost:3306/tec_gurus" />
- <property name="username" value="root" />
- <property name="password" value="root" />
- </bean>
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource" />
- <property name="packagesToScan"
- value="net.tecgurus.persistence.entities" />
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">
- org.hibernate.dialect.MySQLDialect
- </prop>
- </props>
- </property>
- </bean>
- <bean id="transactionManager"
- class="org.springframework.orm.hibernate5.HibernateTransactionManager">
- <property name="sessionFactory" ref="sessionFactory"/>
- </bean>
- <tx:annotation-driven transaction-manager="transactionManager" />
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement