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 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!-- Application context DAO layer -->
<beans>
<!-- ***********************
** Beans Service **
************************ -->
<!-- General -->
<bean id="continentDao" class="dao.nasch.ville.impl.ContinentGeonamesHome">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate"/>
</property>
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- ***************************
** TransactionManager **
***************************** -->
<!-- Gestions des Transactions BDD -->
<!-- Définition du proxy général abstrait de manière globale à l'application -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- ****************************
** TransactionProxy **
***************************** -->
<bean id="transactionProxy" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED, readOnly</prop>
</props>
</property>
</bean>
<!-- ***********************
** BDD DataSource **
************************ -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/villesdumonde</value>
</property>
<property name="username">
<value>****</value>
</property>
<property name="password">
<value>****</value>
</property>
</bean>
<!-- ***************
** Connection **
**************** -->
<bean id="myHibernateProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.use_outer_join">true</prop>
</props>
</property>
</bean>
<!-- ***********************
** SessionFactory **
************************ -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="hibernateProperties">
<ref bean="myHibernateProperties"/>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<!-- <property name="mappingResources">
<list>
<value>Personne.hbm.xml</value>
</list>
</property> -->
</bean>
<!-- ***********************
** JBDC Exception **
************************ -->
<bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLExceptionTranslator">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<!-- ****************************
** Hibernate Template **
**************************** -->
<bean
id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
<property name="jdbcExceptionTranslator">
<ref bean="jdbcExceptionTranslator"/>
</property>
</bean>
</beans> |
Partager