Advertisement
Guest User

Untitled

a guest
Nov 10th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. <beans xmlns="http://www.springframework.org/schema/beans"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
  4. xmlns:mvc="http://www.springframework.org/schema/mvc"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans
  6. http://www.springframework.org/schema/beans/spring-beans.xsd
  7. 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 http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  8.  
  9. <context:component-scan base-package="net.revisorsystem"/>
  10.  
  11. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  12. <property name="prefix" value="/WEB-INF/pages/"/>
  13. <property name="suffix" value=".jsp"/>
  14. </bean>
  15.  
  16. <!-- Database Information -->
  17. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  18. destroy-method="close">
  19. <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
  20. <property name="url"
  21. value="jdbc:mysql://localhost:3306/revisorsystem"/>
  22. <property name="username" value="root"/>
  23. <property name="password" value="160298"/>
  24. </bean>
  25.  
  26. <!-- Hibernate 4 SessionFactory Bean definition -->
  27. <bean id="hibernate4AnnotatedSessionFactory"
  28. class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  29. <property name="dataSource" ref="dataSource"/>
  30. <property name="annotatedClasses">
  31. <list>
  32. <value>net.revisorsystem.model.Owner</value>
  33. </list>
  34. </property>
  35. <property name="hibernateProperties">
  36. <props>
  37. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
  38. </prop>
  39. <prop key="hibernate.show_sql">true</prop>
  40. </props>
  41. </property>
  42. </bean>
  43.  
  44. <!--BookDao and BookService beans-->
  45. <bean id="ownerDao" class="net.revisorsystem.dao.OwnerDaoImpl">
  46. <property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
  47. </bean>
  48.  
  49. <bean id="ownerService" class="net.revisorsystem.service.OwnerServiceImpl">
  50. <property name="ownerDao" ref="ownerDao"/>
  51. </bean>
  52.  
  53. <context:component-scan base-package="net.revisorsystem"/>
  54.  
  55. <tx:annotation-driven transaction-manager="transactionManager"/>
  56.  
  57. <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  58. <property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory"/>
  59. </bean>
  60.  
  61. <mvc:default-servlet-handler/>
  62. <mvc:annotation-driven/>
  63.  
  64. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement