Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman-Common / src / spring / globalContext.xml
index aaffeaf83675b9fd8cb4d27adfdaa1b6c90b8dcc..4ee39ca8d26a7fa00c615d37481560f8511a3603 100644 (file)
@@ -11,5 +11,92 @@ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
 http://www.springframework.org/schema/tx
 http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
 
+       <!--    <bean id="simanDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
+               <property name="jndiName" value="jdbc/ibatis"/>
+               </bean> -->
+
+       <bean id="simanDatasource"
+               class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
+               <property name="driverClassName"
+                       value="org.hibernate.dialect.MySQLInnoDBDialect" />
+               <property name="url" value="jdbc:mysql://localhost/simer" />
+               <property name="username" value="simer" />
+               <property name="password" value="admin" />
+               <property name="suppressClose" value="true" />
+               <property name="autoCommit" value="false" />
+       </bean>
+
+       <bean id="p6spySimanDatasource"
+               class="com.p6spy.engine.spy.P6DataSource">
+               <constructor-arg>
+                       <ref local="simanDatasource" />
+               </constructor-arg>
+       </bean>
+
+       <bean id="simanSessionFactory"
+               class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+               <property name="dataSource" ref="p6spySimanDatasource" />
+               <property name="mappingResources">
+                       <list>
+                               <value>
+                                       org/splat/dal/bo/kernel/Persistent.hbm.xml
+                               </value>
+                               <value>org/splat/dal/bo/kernel/Any.hbm.xml</value>
+                               <value>org/splat/dal/bo/kernel/Entity.hbm.xml</value>
+                               <value>org/splat/dal/bo/kernel/Attribute.hbm.xml</value>
+                               <value>org/splat/dal/bo/kernel/Relation.hbm.xml</value>
+                               <value>
+                                       org/splat/dal/bo/kernel/TextAttribute.hbm.xml
+                               </value>
+                               <value>org/splat/dal/bo/kernel/User.hbm.xml</value>
+
+                               <value>
+                                       org/splat/dal/bo/som/ProjectElement.hbm.xml
+                               </value>
+                               <value>org/splat/dal/bo/som/Study.hbm.xml</value>
+                               <value>org/splat/dal/bo/som/Scenario.hbm.xml</value>
+                               <value>org/splat/dal/bo/som/Attributes.hbm.xml</value>
+                               <value>org/splat/dal/bo/som/Relations.hbm.xml</value>
+                               <value>org/splat/dal/bo/som/File.hbm.xml</value>
+                               <value>org/splat/dal/bo/som/Document.hbm.xml</value>
+                               <value>org/splat/dal/bo/som/Publication.hbm.xml</value>
+                               <value>
+                                       org/splat/dal/bo/som/ValidationCycle.hbm.xml
+                               </value>
+                               <value>org/splat/dal/bo/som/Timestamp.hbm.xml</value>
+                               <value>
+                                       org/splat/dal/bo/som/SimulationContext.hbm.xml
+                               </value>
+                               <value>
+                                       org/splat/dal/bo/som/KnowledgeElement.hbm.xml
+                               </value>
+                               <value>org/splat/dal/bo/som/IDBuilder.hbm.xml</value>
+                       </list>
+               </property>
+               <property name="hibernateProperties">
+                       <value>
+                               hibernate.dialect=org.hibernate.dialect.HSQLDialect
+                               hibernate.show_sql=true hbm2ddl.auto=update
+                               hibernate.current_session_context_class=thread
+                       </value>
+               </property>
+               <property name="exposeTransactionAwareSessionFactory">
+                       <value>false</value>
+               </property>
+       </bean>
+
+       <bean id="txManager"
+               class="org.springframework.orm.hibernate3.HibernateTransactionManager">
+               <property name="dataSource" ref="p6spySimanDatasource" />
+               <property name="sessionFactory" ref="simanSessionFactory" />
+       </bean>
+
+       <tx:annotation-driven transaction-manager="txManager" />
+
+       <bean id="database" class="org.splat.dal.dao.som.Database">
+               <property name="sessionFactory" ref="simanSessionFactory" />
+               <property name="indexService" ref="indexService"/>
+               <property name="repositoryService" ref="repositoryService"/>
+       </bean>
 
 </beans>