]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/test/spring/ut-datasourceContext.xml
Salome HOME
Now som.xml can be loaded
[tools/siman.git] / Workspace / Siman-Common / src / test / spring / ut-datasourceContext.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         <!--    <bean id="simanDatasource"
31                 class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
32                 <property name="driverClassName"
33                 value="${connection.driver_class}" />
34                 <property name="url" value="${connection.url}" />
35                 <property name="username" value="${connection.username}" />
36                 <property name="password" value="${connection.password}" />
37                 <property name="suppressClose" value="true" />
38                 <property name="autoCommit" value="false" />
39                 </bean>-->
40
41         <bean id="p6spySimanDatasource"
42                 class="com.p6spy.engine.spy.P6DataSource">
43                 <constructor-arg>
44                         <ref local="simanDatasource" />
45                 </constructor-arg>
46         </bean>
47
48
49         <bean id="hibernateProperties"
50                 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
51                 <property name="properties">
52                         <props>
53                                 <!-- normal properties -->
54                         </props>
55                 </property>
56                 <!-- hibernate.config should be defined somewhere in the spring.properties layers -->
57                 <property name="locations">
58                         <list>
59                                 <value>classpath:test/${hibernate.config.file}</value>
60                         </list>
61                 </property>
62         </bean>
63
64         <bean id="simanSessionFactory"
65                 class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
66                 <property name="dataSource" ref="simanDatasource" />
67                 <property name="mappingResources">
68                         <list>
69                                 <value>
70                                         org/splat/dal/bo/kernel/Persistent.hbm.xml
71                                 </value>
72                                 <value>org/splat/dal/bo/kernel/Any.hbm.xml</value>
73                                 <value>org/splat/dal/bo/kernel/Entity.hbm.xml</value>
74                                 <value>org/splat/dal/bo/kernel/Attribute.hbm.xml</value>
75                                 <value>org/splat/dal/bo/kernel/Relation.hbm.xml</value>
76                                 <value>
77                                         org/splat/dal/bo/kernel/TextAttribute.hbm.xml
78                                 </value>
79                                 <value>org/splat/dal/bo/kernel/User.hbm.xml</value>
80
81                                 <value>
82                                         org/splat/dal/bo/som/ProjectElement.hbm.xml
83                                 </value>
84                                 <value>org/splat/dal/bo/som/Study.hbm.xml</value>
85                                 <value>org/splat/dal/bo/som/Scenario.hbm.xml</value>
86                                 <value>org/splat/dal/bo/som/Attributes.hbm.xml</value>
87                                 <value>org/splat/dal/bo/som/Relations.hbm.xml</value>
88                                 <value>org/splat/dal/bo/som/File.hbm.xml</value>
89                                 <value>org/splat/dal/bo/som/Document.hbm.xml</value>
90                                 <value>org/splat/dal/bo/som/Publication.hbm.xml</value>
91                                 <value>
92                                         org/splat/dal/bo/som/ValidationCycle.hbm.xml
93                                 </value>
94                                 <value>org/splat/dal/bo/som/Timestamp.hbm.xml</value>
95                                 <value>
96                                         org/splat/dal/bo/som/SimulationContext.hbm.xml
97                                 </value>
98                                 <value>
99                                         org/splat/dal/bo/som/KnowledgeElement.hbm.xml
100                                 </value>
101                                 <value>org/splat/dal/bo/som/IDBuilder.hbm.xml</value>
102                         </list>
103                 </property>
104                 <!-- hibernate.connection.driver_class=com.p6spy.engine.spy.P6SpyDriver -->
105
106                 <property name="hibernateProperties">
107                         <ref local="hibernateProperties" />
108                 </property>
109                 <!-- The following property is used temporary to be able to manage transactions manually. -->
110                 <!-- TODO: use annotations to mark transaction methods 
111                         instead of programmatic transaction management  -->
112                 <!--         <property name="exposeTransactionAwareSessionFactory">
113                         <value>false</value>
114                         </property>-->
115                 <!--         <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />-->
116         </bean>
117
118         <bean id="txManager"
119                 class="org.springframework.orm.hibernate3.HibernateTransactionManager">
120                 <property name="sessionFactory" ref="simanSessionFactory" />
121                 <property name="nestedTransactionAllowed" value="true" />
122         </bean>
123
124         <tx:annotation-driven transaction-manager="txManager" />
125
126 </beans>