source: geisa/persistence/implementation/hibernate.cfg.xml @ 533

Last change on this file since 533 was 533, checked in by npipsl, 12 years ago

Mise en place 2 couches

  • hibernate
  • service
File size: 2.4 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
3
4<beans>
5        <!-- sessionFactory -->
6        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
7                <property name="configLocation">
8                        <value>classpath:hibernate-domain.cfg.xml</value>
9                </property>
10
11                <property name="configurationClass">
12                        <value>org.hibernate.cfg.AnnotationConfiguration</value>
13                </property>
14
15                <property name="hibernateProperties">
16                        <props>
17                                <prop key="hibernate.bytecode.use_reflection_optimizer">false</prop>
18                                <!--<prop key="hibernate.connection.driver_class">org.postgresql.Driver</prop>-->
19                                <!--<prop key="hibernate.connection.url">jdbc:postgresql://darkstar.ipslnet:5432/PROJECT_SOURCE</prop>-->
20                                <!--<prop key="hibernate.connection.username">postgres</prop>-->
21                                <!--<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>-->
22                <prop key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
23                <prop key="hibernate.connection.url">jdbc:mysql://localhost/geisa</prop>
24                <prop key="hibernate.connection.username">root</prop>
25                <prop key="hibernate.connection.password">geisa11</prop>
26                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
27                <prop key="hibernate.show_sql">true</prop>
28                                <prop key="hibernate.generate_statistics">true</prop>
29                        </props>
30                </property>
31        </bean>
32
33        <bean id="transactionManager"
34                class="org.springframework.orm.hibernate3.HibernateTransactionManager">
35                <property name="sessionFactory" ref="sessionFactory" />
36        </bean>
37
38        <bean id="transactionProxy" abstract="true"
39                class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
40                <property name="transactionManager">
41                        <ref bean="transactionManager" />
42                </property>
43                <property name="transactionAttributes">
44                        <props>
45                                <prop key="insert*">PROPAGATION_REQUIRED</prop>
46                                <prop key="update*">PROPAGATION_REQUIRED</prop>
47                                <prop key="save*">PROPAGATION_REQUIRED</prop>
48                                <prop key="*">PROPAGATION_REQUIRED, readOnly</prop>
49                        </props>
50                </property>
51        </bean>
52
53        <!-- <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> -->
54        <!-- <property name="sessionFactory" ref="sessionFactory" /> -->
55        <!-- </bean> -->
56
57</beans>
Note: See TracBrowser for help on using the repository browser.