]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/spring/globalContext.xml
Salome HOME
Fixed: adding a knowledge element (but there is still a double addition), opening...
[tools/siman.git] / Workspace / Siman-Common / src / spring / globalContext.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4         xmlns:aop="http://www.springframework.org/schema/aop"
5         xmlns:context="http://www.springframework.org/schema/context"
6         xmlns:tx="http://www.springframework.org/schema/tx"
7         xsi:schemaLocation="
8 http://www.springframework.org/schema/beans
9 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
10 http://www.springframework.org/schema/aop
11 http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
12 http://www.springframework.org/schema/context
13 http://www.springframework.org/schema/context/spring-context-3.0.xsd
14 http://www.springframework.org/schema/tx
15 http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
16
17         <!--    <bean id="simanDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
18                 <property name="jndiName" value="jdbc/ibatis"/>
19                 </bean> -->
20
21         <!--    <bean id="simanDatasource"
22                 class="org.springframework.jdbc.datasource.DriverManagerDataSource">
23                 <property name="driverClassName"
24                         value="${connection.driver_class}" />
25                 <property name="url" value="${connection.url}" />
26                 <property name="username" value="${connection.username}" />
27                 <property name="password" value="${connection.password}" />
28         </bean>
29         -->
30
31         <context:property-placeholder
32                 location="classpath:siman.properties,classpath:jdbc.properties"
33                 ignore-unresolvable="true" />
34
35         <bean id="simanDatasource"
36                 class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
37                 <property name="driverClassName"
38                         value="${connection.driver_class}" />
39                 <property name="url" value="${connection.url}" />
40                 <property name="username" value="${connection.username}" />
41                 <property name="password" value="${connection.password}" />
42                 <property name="suppressClose" value="true" />
43                 <property name="autoCommit" value="false" />
44         </bean>
45
46         <bean id="p6spySimanDatasource"
47                 class="com.p6spy.engine.spy.P6DataSource">
48                 <constructor-arg>
49                         <ref local="simanDatasource" />
50                 </constructor-arg>
51         </bean>
52
53
54         <bean id="hibernateProperties"
55                 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
56                 <property name="properties">
57                         <props>
58                                 <!-- normal properties -->
59                         </props>
60                 </property>
61                 <!-- hibernate.config should be defined somewhere in the spring.properties layers -->
62                 <property name="locations">
63                         <list>
64                                 <value>classpath:${hibernate.config.file}</value>
65                         </list>
66                 </property>
67         </bean>
68
69         <bean id="simanSessionFactory"
70                 class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
71                 <property name="dataSource" ref="simanDatasource" />
72                 <property name="mappingResources">
73                         <list>
74                                 <value>
75                                         org/splat/dal/bo/kernel/Persistent.hbm.xml
76                                 </value>
77                                 <value>org/splat/dal/bo/kernel/Any.hbm.xml</value>
78                                 <value>org/splat/dal/bo/kernel/Entity.hbm.xml</value>
79                                 <value>org/splat/dal/bo/kernel/Attribute.hbm.xml</value>
80                                 <value>org/splat/dal/bo/kernel/Relation.hbm.xml</value>
81                                 <value>
82                                         org/splat/dal/bo/kernel/TextAttribute.hbm.xml
83                                 </value>
84                                 <value>org/splat/dal/bo/kernel/User.hbm.xml</value>
85
86                                 <value>
87                                         org/splat/dal/bo/som/ProjectElement.hbm.xml
88                                 </value>
89                                 <value>org/splat/dal/bo/som/Study.hbm.xml</value>
90                                 <value>org/splat/dal/bo/som/Scenario.hbm.xml</value>
91                                 <value>org/splat/dal/bo/som/Attributes.hbm.xml</value>
92                                 <value>org/splat/dal/bo/som/Relations.hbm.xml</value>
93                                 <value>org/splat/dal/bo/som/File.hbm.xml</value>
94                                 <value>org/splat/dal/bo/som/Document.hbm.xml</value>
95                                 <value>org/splat/dal/bo/som/Publication.hbm.xml</value>
96                                 <value>
97                                         org/splat/dal/bo/som/ValidationCycle.hbm.xml
98                                 </value>
99                                 <value>org/splat/dal/bo/som/Timestamp.hbm.xml</value>
100                                 <value>
101                                         org/splat/dal/bo/som/SimulationContext.hbm.xml
102                                 </value>
103                                 <value>
104                                         org/splat/dal/bo/som/KnowledgeElement.hbm.xml
105                                 </value>
106                                 <value>org/splat/dal/bo/som/IDBuilder.hbm.xml</value>
107                         </list>
108                 </property>
109                 <!-- hibernate.connection.driver_class=com.p6spy.engine.spy.P6SpyDriver -->
110
111                 <property name="hibernateProperties">
112                         <ref local="hibernateProperties" />
113                 </property>
114                 <!-- The following property is used temporary to be able to manage transactions manually. -->
115                 <!-- TODO: use annotations to mark transaction methods 
116                         instead of programmatic transaction management  -->
117                 <property name="exposeTransactionAwareSessionFactory">
118                         <value>false</value>
119                 </property>
120         </bean>
121
122         <bean id="txManager"
123                 class="org.springframework.orm.hibernate3.HibernateTransactionManager">
124                 <property name="sessionFactory" ref="simanSessionFactory" />
125         </bean>
126
127         <tx:annotation-driven transaction-manager="txManager" />
128
129         <!-- TODO: Replace database by services and DAOs -->
130         <bean id="database" class="org.splat.dal.dao.som.Database">
131                 <property name="sessionFactory" ref="simanSessionFactory" />
132                 <property name="indexService" ref="indexService" />
133                 <property name="repositoryService" ref="repositoryService" />
134         </bean>
135
136 </beans>