Advertisement
Guest User

Untitled

a guest
May 10th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans
  3. xmlns="http://www.springframework.org/schema/beans"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  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/context
  11. http://www.springframework.org/schema/context/spring-context-4.2.xsd
  12. http://www.springframework.org/schema/tx
  13. http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
  14.  
  15. <tx:annotation-driven/>
  16.  
  17. <context:component-scan base-package="palinfo.com.monProjet.dao"></context:component-scan>
  18.  
  19. <context:component-scan base-package="palinfo.com.monProjet.service"></context:component-scan>
  20.  
  21. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  22. destroy-method="close">
  23. <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  24. <property name="url" value="jdbc:mysql://localhost:3307/maBase" />
  25. <property name="username" value="root" />
  26. <property name="password" value="" />
  27. </bean>
  28.  
  29. <bean id="hibernateAnnotatedSessionFactory"
  30. class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
  31.  
  32. <property name="dataSource" ref="dataSource" />
  33.  
  34. <property name="annotatedClasses">
  35. <list>
  36. <value>palinfo.com.monProjet.model.Utilisateur</value>
  37. <value>palinfo.com.monProjet.model.Perso</value>
  38. <value>palinfo.com.monProjet.model.Mdp</value>
  39. </list>
  40. </property>
  41.  
  42. <property name="hibernateProperties">
  43. <props>
  44. <prop key="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
  45. <prop key="current_session_context_class">thread</prop>
  46. <prop key="show_sql">false</prop>
  47. </props>
  48. </property>
  49.  
  50. </bean>
  51.  
  52. <bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
  53. <property name="sessionFactory" ref="hibernateAnnotatedSessionFactory"></property>
  54. </bean>
  55.  
  56. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement