Advertisement
Guest User

context

a guest
Dec 12th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 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"
  5. xmlns:mvc="http://www.springframework.org/schema/mvc"
  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/context
  11. http://www.springframework.org/schema/context/spring-context.xsd
  12. http://www.springframework.org/schema/mvc
  13.  
  14. http://www.springframework.org/schema/mvc/spring-mvc.xsd
  15. ">
  16.  
  17.  
  18. <context:component-scan base-package="it.navigator"/>
  19.  
  20.  
  21. <mvc:annotation-driven/>
  22. <tx:annotation-driven transaction-manager="transactionManager"/>
  23.  
  24. <bean
  25. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  26. <property name="prefix" value="/WEB-INF/view/"/>
  27. <property name="suffix" value=".jsp"/>
  28. </bean>
  29. <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  30. <property name="driverClassName" value="com.mysql"/>
  31. <property name="url" value="jdbc:mysql://localhost:3306/itNavigator"/>
  32. <property name="username" value="root"/>
  33. <property name="password" value=""/>
  34.  
  35. </bean>
  36.  
  37. <bean id="sessionFactory"
  38. class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
  39. <property name="dataSource" ref="dataSource"/>
  40. <property name="hibernateProperties">
  41. <props>
  42. <prop key="hibernate.dialect">
  43. org.hibernate.dialect.MySQLDialect
  44. </prop>
  45. <prop key="hibernate.show_sql">
  46. true
  47. </prop>
  48. <prop key="hibernate.format_sql">true</prop>
  49. <prop key="hibernate.connection.url">jdbc:mysql://localhost:3306/itNavigator</prop>
  50. <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
  51.  
  52.  
  53. </props>
  54. </property>
  55. <property name="mappingLocations">
  56. <list>
  57. <value>classpath:it/navigator/entity/ClientEntity.hbm.xml</value>
  58. <value>classpath:it/navigator/entity/TelefoneEntity.hbm.xml</value>
  59. </list>
  60. </property>
  61. </bean>
  62.  
  63. <bean id="transactionManager"
  64. class="org.springframework.orm.hibernate5.HibernateTransactionManager">
  65. <property name="sessionFactory" ref="sessionFactory"/>
  66. </bean>
  67.  
  68.  
  69. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement