applicationContext-hibernate.xml
3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- INICIO envers -->
<!-- <bean name="auditEventListener" class="org.hibernate.envers.event.AuditEventListener" /> -->
<!-- FIM Envers -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
autowire-candidate="true" lazy-init="false">
<property name="dataSource" ref="dataSource" />
<!-- <property name="eventListeners">
<map>
<entry key="post-insert">
<list>
<ref bean="auditEventListener" />
</list>
</entry>
<entry key="post-update">
<list>
<ref bean="auditEventListener" />
</list>
</entry>
<entry key="post-delete">
<list>
<ref bean="auditEventListener" />
</list>
</entry>
<entry key="pre-collection-update">
<ref bean="auditEventListener" />
</entry>
<entry key="pre-collection-remove">
<ref bean="auditEventListener" />
</entry>
<entry key="post-collection-recreate">
<ref bean="auditEventListener" />
</entry>
</map>
</property> -->
<!-- FIM envers -->
<property name="hibernateProperties">
<props>
<!--
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
-->
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.order_updates">true</prop>
<prop key="hibernate.auto_commit">false</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.archive.autodetection">class</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
<!-- Usado para não abrir muitas conexões com o BD -->
<prop key="hibernate.connection.release_mode">after_statement</prop>
<!--
<prop key="org.hibernate.envers.audit_table_prefix">LOG_</prop>
<prop key="org.hibernate.envers.audit_table_suffix"></prop>
<prop key="org.hibernate.envers.revision_type_field_name">NUM_OPERACAO</prop>
<prop key="org.hibernate.envers.revision_field_name">ID_AUDITORIA</prop>
<prop key="org.hibernate.envers.store_data_at_delete">true</prop>
<prop key="org.hibernate.envers.default_schema">LOG</prop>
<prop key="org.hibernate.envers.default_catalog">RPNBL</prop>
-->
</props>
</property>
<property name="annotatedClasses">
<bean factory-bean="scannerClass" factory-method="getClasses" />
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="autodetectDataSource" value="true" />
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="scannerClass" class="br.gov.arquitetura.util.AnnotatedEntityDetector">
<property name="basePackage" value="br.gov.mc.corporativo.*,br.gov.mc.*" />
<!--
<property name="basePackage" value="br.gov.mc.cadsei,br.gov.arquitetura,br.gov.mc.cadsei.entidade,br.gov.mc.cadsei.service,br.gov.mc.cadsei.service.impl,br.gov.mc.arquitetura.persistencia.impl,br.gov.arquitetura.service.impl" />
-->
</bean>
</beans>