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:context="http://www.springframework.org/schema/context"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- 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/context
- http://www.springframework.org/schema/context/spring-context.xsd
- http://www.springframework.org/schema/mvc
- http://www.springframework.org/schema/mvc/spring-mvc.xsd
- ">
- <context:component-scan base-package="it.navigator"/>
- <mvc:annotation-driven/>
- <tx:annotation-driven transaction-manager="transactionManager"/>
- <bean
- class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/view/"/>
- <property name="suffix" value=".jsp"/>
- </bean>
- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
- <property name="driverClassName" value="com.mysql"/>
- <property name="url" value="jdbc:mysql://localhost:3306/itNavigator"/>
- <property name="username" value="root"/>
- <property name="password" value=""/>
- </bean>
- <bean id="sessionFactory"
- class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
- <property name="dataSource" ref="dataSource"/>
- <property name="hibernateProperties">
- <props>
- <prop key="hibernate.dialect">
- org.hibernate.dialect.MySQLDialect
- </prop>
- <prop key="hibernate.show_sql">
- true
- </prop>
- <prop key="hibernate.format_sql">true</prop>
- <prop key="hibernate.connection.url">jdbc:mysql://localhost:3306/itNavigator</prop>
- <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
- </props>
- </property>
- <property name="mappingLocations">
- <list>
- <value>classpath:it/navigator/entity/ClientEntity.hbm.xml</value>
- <value>classpath:it/navigator/entity/TelefoneEntity.hbm.xml</value>
- </list>
- </property>
- </bean>
- <bean id="transactionManager"
- class="org.springframework.orm.hibernate5.HibernateTransactionManager">
- <property name="sessionFactory" ref="sessionFactory"/>
- </bean>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement