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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
| <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- ======================== DEFINITIONS PERSISTANCE ======================== -->
<!-- - - - - - - - - - - - - Source de donnée - - - - - - - - - - - - -->
<!-- Base de donnée cible : Mysql -->
<!-- AUthentification : User + Password -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<bean id="dataSourceSTK"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@10.156.20.55:1521:orcl</value>
</property>
<property name="username"><value>amid</value></property>
<property name="password"><value>amid</value></property>
</bean>
<!-- - - - - - - - - - - - - Session Factory - - - - - - - - - - - - -->
<!-- Gère les accès aux données via Hibernate -->
<!-- Permet la création d'une base V0 : property hibernate.hbm2ddl.auto -->
<!-- Liste les tous les fichiers de mapping hbm.xml de l'application -->
<!-- Bindée à la source de donnée -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<bean id="sessionFactorySTK"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<!-- prop key="hibernate.hbm2ddl.auto">create</prop-->
<!-- prop key="hibernate.cglib.use_reflection_optimizer">true</prop-->
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSourceSTK"/>
</property>
<property name="mappingResources">
<list>
<value>com/anam/amid/bo/Action.hbm.xml</value>
<value>com/anam/amid/bo/Droits.hbm.xml</value>
<value>com/anam/amid/bo/Profil.hbm.xml</value>
<value>com/anam/amid/bo/Utilisateur.hbm.xml</value>
<value>com/anam/amid/bo/Ald.hbm.xml</value>
<value>com/anam/amid/bo/Cim10.hbm.xml</value>
<value>com/anam/amid/bo/ClasseAld.hbm.xml</value>
<value>com/anam/amid/bo/ClasseTerapeutique.hbm.xml</value>
<value>com/anam/amid/bo/Composition.hbm.xml</value>
<value>com/anam/amid/bo/Dci.hbm.xml</value>
<value>com/anam/amid/bo/Medicament.hbm.xml</value>
<value>com/anam/amid/bo/MedicamentAld.hbm.xml</value>
<value>com/anam/amid/bo/Prix.hbm.xml</value>
</list>
</property>
</bean>
<!-- - - - - - - - - - - Gestionnaire de transactions - - - - - - - - - -->
<!-- Gestionnaire des transactions pour une session hibernate unique -->
<!-- Alternative à JTA (Java Transaction API) pour la gestion des transactions-->
<!-- Bindée à la session factory -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<bean id="transactionManagerSTK" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactorySTK" />
</property>
</bean>
<!-- ======================== DEFINITIONS DES SERVICES ======================= -->
<!-- - - - - - - - - - - - - Données de référence - - - - - - - - - - - -->
<!-- Contient tous les services génériques SaveBo,SaveListBo, UpdateBo ... -->
<!-- Par défaut ce service est accessible à partir de toutes les actions et -->
<!-- de toutes les autres couches de service -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- SERVICE DES DONNEES DE REFERENCE -->
<bean id="referenceDataService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManagerSTK"/></property>
<property name="target"><ref local="referenceDataTarget"/></property>
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_REQUIRED,readOnly,-Exception</prop>
<prop key="update*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="save*">PROPAGATION_REQUIRED,-Exception</prop>
<prop key="delete*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
<!-- Classe d'implémentation du service des données de reference -->
<!-- Possède une relation avec la couche DAO dudit service -->
<bean id="referenceDataTarget" class="com.anam.amid.referentiel.service.spring.ReferenceDataServiceSpringImpl">
<property name="referenceDataDAO"><ref local="referenceDataDAO"/></property>
</bean>
<!-- Couche DAO du service des données de reference -->
<!-- Possède une relation avec l'implementation hibernate de l'application : sessionFactorySTK -->
<bean id="referenceDataDAO" class="com.anam.amid.referentiel.service.dao.hibernate.ReferenceDataHibernateDAO">
<property name="sessionFactory"><ref local="sessionFactorySTK"/></property>
</bean>
<!-- - - - - - - - - - - - - Module Administration - - - - - - - - - - - -->
<!-- Contient tous les services spécifiques au module administration -->
<!-- Dans le cadre d'une conception cohérente, ne doit pas contenir de -->
<!-- services de type générique car il a accès aux services de référence -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- SERVICE DU MODULE ADMINISTRATION -->
<bean id="administrationDataService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManagerSTK"/></property>
<property name="target"><ref local="administrationDataTarget"/></property>
<property name="transactionAttributes">
<props>
<prop key="deleteListUtilisateurs">
PROPAGATION_REQUIRED,
-com.archos.conseil.softwork.exception.livraison.OrdreChargementPKException
</prop>
<prop key="get*">PROPAGATION_REQUIRED,readOnly,-Exception</prop>
</props>
</property>
</bean>
<!-- Classe d'implémentation du service du module administration -->
<!-- Possède une relation avec la couche DAO dudit service -->
<!-- administrationTarget primary business object implementation -->
<bean id="administrationDataTarget" class="com.anam.amid.administration.service.spring.AdministrationDataServiceSpringImpl">
<property name="administrationDataDAO"><ref local="administrationDataDAO"/></property>
<property name="referenceDataService"><ref local="referenceDataService"/></property>
</bean>
<!-- Couche DAO du service du module administration -->
<!-- Possède une relation avec l'implementation hibernate de l'application : sessionFactorySTK -->
<bean id="administrationDataDAO" class="com.anam.amid.administration.service.dao.hibernate.AdministrationDataHibernateDAO">
<property name="sessionFactory"><ref local="sessionFactorySTK"/></property>
</bean>
</beans> |
Partager