Advertisement
wagnersousa

Untitled

Feb 3rd, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. <beans xmlns="http://www.springframework.org/schema/beans"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  3. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  4. xsi:schemaLocation="http://www.springframework.org/schema/beans
  5. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  6. http://www.springframework.org/schema/context
  7. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  8. http://www.springframework.org/schema/tx
  9. http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
  10. http://www.springframework.org/schema/aop
  11. http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
  12.  
  13. <context:annotation-config />
  14. <context:component-scan base-package="br.com.grupofortes.intranet" />
  15. <context:component-scan base-package="base.dbunit" />
  16.  
  17. <context:property-placeholder location="classpath:configuracoes-test.properties" />
  18.  
  19. <bean id="dataSource" class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
  20. <property name="driverClassName" value="org.postgresql.Driver"/>
  21. <property name="url" value="jdbc:postgresql://localhost:5432/intranet_test"/>
  22. <property name="username" value="postgres"/>
  23. <property name="password" value="root"/>
  24. <property name="suppressClose" value="true" />
  25. </bean>
  26.  
  27. <!-- Configuração do Aspecto das transações. -->
  28. <tx:advice id="txAdviceIntranet" transaction-manager="transactionManagerIntranet">
  29. <tx:attributes>
  30. <tx:method name="*" propagation="REQUIRED" />
  31. </tx:attributes>
  32. </tx:advice>
  33.  
  34. <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
  35. <property name="dataSource" ref="dataSource"></property>
  36. <property name="configLocation" value="classpath:hibernate.cfg.xml" />
  37. <property name="packagesToScan" value="br.com.grupofortes.intranet" />
  38. </bean>
  39.  
  40. <bean id="transactionManagerIntranet" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  41. <property name="sessionFactory" ref="sessionFactory" />
  42. </bean>
  43.  
  44. <aop:config>
  45. <aop:pointcut id="intranetDaoMethods" expression="execution(* br.com.grupofortes.intranet.dao.impl..*.*(..))" />
  46. <aop:advisor advice-ref="txAdviceIntranet" pointcut-ref="intranetDaoMethods" />
  47. </aop:config>
  48. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement