Advertisement
Guest User

Untitled

a guest
Jul 14th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. <context:component-scan base-package="com.jaive.test.dao" />
  2. <context:component-scan base-package="com.jaive.test.service" />
  3.  
  4. <import resource="data.xml" />
  5.  
  6. <?xml version="1.0" encoding="UTF-8"?>
  7. <beans xmlns="http://www.springframework.org/schema/beans"
  8. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
  9. xmlns:context="http://www.springframework.org/schema/context"
  10. xmlns:jee="http://www.springframework.org/schema/jee" xmlns:lang="http://www.springframework.org/schema/lang"
  11. xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
  12. xmlns:util="http://www.springframework.org/schema/util"
  13. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  14. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  15. http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
  16. http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
  17. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
  18. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
  19.  
  20.  
  21. <tx:annotation-driven transaction-manager="transactionManager" />
  22.  
  23. <bean id="transactionManager"
  24. class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  25. <property name="sessionFactory" ref="sessionFactory" />
  26. </bean>
  27.  
  28. <bean id="messageSource"
  29. class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
  30. <property name="basename" value="classpath:messages" />
  31. <property name="defaultEncoding" value="UTF-8" />
  32. </bean>
  33.  
  34. <bean id="propertyConfigurer"
  35. class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
  36. p:location="/WEB-INF/jdbc.properties" />
  37.  
  38. <bean id="dataSource"
  39. class="org.springframework.jdbc.datasource.DriverManagerDataSource"
  40. p:driverClassName="${jdbc.driverClassName}"
  41. p:url="${jdbc.databaseurl}"
  42. p:username="${jdbc.username}"
  43. p:password="${jdbc.password}" />
  44.  
  45. <bean id="sessionFactory"
  46. class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  47. <property name="dataSource" ref="dataSource" />
  48. <property name="configLocation">
  49. <value>classpath:hibernate.cfg.xml</value>
  50. </property>
  51. <property name="configurationClass">
  52. <value>org.hibernate.cfg.AnnotationConfiguration</value>
  53. </property>
  54. <property name="hibernateProperties">
  55. <props>
  56. <prop key="hibernate.show_sql">true</prop>
  57. <prop key="hibernate.dialect">${jdbc.dialect}</prop>
  58. <prop key="hibernate.connection.charSet">UTF-8</prop>
  59. </props>
  60. </property>
  61. </bean>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement