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