Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[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:tx="http://www.springframework.org/schema/tx"
6         xsi:schemaLocation="
7 http://www.springframework.org/schema/beans
8 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
9 http://www.springframework.org/schema/aop
10 http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
11 http://www.springframework.org/schema/tx
12 http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
13
14         <!--    <bean id="simanDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
15                 <property name="jndiName" value="jdbc/ibatis"/>
16                 </bean> -->
17
18         <bean id="simanDatasource"
19                 class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
20                 <property name="driverClassName"
21                         value="org.hibernate.dialect.MySQLInnoDBDialect" />
22                 <property name="url" value="jdbc:mysql://localhost/simer" />
23                 <property name="username" value="simer" />
24                 <property name="password" value="admin" />
25                 <property name="suppressClose" value="true" />
26                 <property name="autoCommit" value="false" />
27         </bean>
28
29         <bean id="p6spySimanDatasource"
30                 class="com.p6spy.engine.spy.P6DataSource">
31                 <constructor-arg>
32                         <ref local="simanDatasource" />
33                 </constructor-arg>
34         </bean>
35
36         <bean id="simanSessionFactory"
37                 class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
38                 <property name="dataSource" ref="p6spySimanDatasource" />
39                 <property name="mappingResources">
40                         <list>
41                                 <value>
42                                         org/splat/dal/bo/kernel/Persistent.hbm.xml
43                                 </value>
44                                 <value>org/splat/dal/bo/kernel/Any.hbm.xml</value>
45                                 <value>org/splat/dal/bo/kernel/Entity.hbm.xml</value>
46                                 <value>org/splat/dal/bo/kernel/Attribute.hbm.xml</value>
47                                 <value>org/splat/dal/bo/kernel/Relation.hbm.xml</value>
48                                 <value>
49                                         org/splat/dal/bo/kernel/TextAttribute.hbm.xml
50                                 </value>
51                                 <value>org/splat/dal/bo/kernel/User.hbm.xml</value>
52
53                                 <value>
54                                         org/splat/dal/bo/som/ProjectElement.hbm.xml
55                                 </value>
56                                 <value>org/splat/dal/bo/som/Study.hbm.xml</value>
57                                 <value>org/splat/dal/bo/som/Scenario.hbm.xml</value>
58                                 <value>org/splat/dal/bo/som/Attributes.hbm.xml</value>
59                                 <value>org/splat/dal/bo/som/Relations.hbm.xml</value>
60                                 <value>org/splat/dal/bo/som/File.hbm.xml</value>
61                                 <value>org/splat/dal/bo/som/Document.hbm.xml</value>
62                                 <value>org/splat/dal/bo/som/Publication.hbm.xml</value>
63                                 <value>
64                                         org/splat/dal/bo/som/ValidationCycle.hbm.xml
65                                 </value>
66                                 <value>org/splat/dal/bo/som/Timestamp.hbm.xml</value>
67                                 <value>
68                                         org/splat/dal/bo/som/SimulationContext.hbm.xml
69                                 </value>
70                                 <value>
71                                         org/splat/dal/bo/som/KnowledgeElement.hbm.xml
72                                 </value>
73                                 <value>org/splat/dal/bo/som/IDBuilder.hbm.xml</value>
74                         </list>
75                 </property>
76                 <property name="hibernateProperties">
77                         <value>
78                                 hibernate.dialect=org.hibernate.dialect.HSQLDialect
79                                 hibernate.show_sql=true hbm2ddl.auto=update
80                                 hibernate.current_session_context_class=thread
81                         </value>
82                 </property>
83                 <property name="exposeTransactionAwareSessionFactory">
84                         <value>false</value>
85                 </property>
86         </bean>
87
88         <bean id="txManager"
89                 class="org.springframework.orm.hibernate3.HibernateTransactionManager">
90                 <property name="dataSource" ref="p6spySimanDatasource" />
91                 <property name="sessionFactory" ref="simanSessionFactory" />
92         </bean>
93
94         <tx:annotation-driven transaction-manager="txManager" />
95
96         <bean id="database" class="org.splat.dal.dao.som.Database">
97                 <property name="sessionFactory" ref="simanSessionFactory" />
98                 <property name="indexService" ref="indexService"/>
99                 <property name="repositoryService" ref="repositoryService"/>
100         </bean>
101
102 </beans>