blob: 610c24bbf626da14fe8b81c075c776f2c90d5952 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Dao implementations based on Spring's hibernate templates -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:raven="http://taverna.sf.net/schema/artifact-support"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://taverna.sf.net/schema/artifact-support
http://taverna.sf.net/schema/artifact-support/artifact-support.xsd">
<!-- An SPI-enabled hibernate session factory -->
<bean id="t2reference.orm.h3.sessionFactory"
class="org.apache.taverna.platform.spring.orm.hibernate3.SpiRegistryAwareLocalSessionFactoryBean">
<property name="dataSource">
<ref bean="t2reference.jdbc.datasource" />
</property>
<property name="hibernateProperties">
<ref bean="t2reference.orm.h3.properties" />
</property>
<property name="lobHandler">
<bean
class="org.springframework.jdbc.support.lob.DefaultLobHandler" />
</property>
<!-- Need to map the abstract superclass for the SPI first, SPI classes -->
<!-- are subclasses of this and hibernate can be picky about the order -->
<property name="mappingResources">
<list>
<value>
org/apache/taverna/reference/AbstractExternalReference.hbm.xml
</value>
</list>
</property>
<!-- SPI enabled session, uses the linked SPI registry or registries -->
<!-- to gather Class definitions and uses the slightly patched hibernate -->
<!-- to ensure that raven is used to fetch these back when required -->
<property name="spiRegistries">
<list>
<!-- SPI used by the raven-aware hibernate session factory bean -->
<!-- This *must* go before the external reference SPI bean or -->
<!-- those beans won't find the mapping for their superclasses -->
<bean
class="org.apache.taverna.platform.spring.SpiRegistryFactoryBean">
<property name="repository">
<ref bean="raven.repository" />
</property>
<property name="spiClassName"
value="org.apache.taverna.reference.h3.HibernateMappedEntity" />
</bean>
<!-- SPI used by the raven-aware hibernate session factory bean -->
<bean
class="org.apache.taverna.platform.spring.SpiRegistryFactoryBean">
<property name="repository">
<ref bean="raven.repository" />
</property>
<property name="spiClassName"
value="org.apache.taverna.reference.ExternalReferenceSPI" />
</bean>
</list>
</property>
<property name="preloadRegistries">
<list>
<bean
class="org.apache.taverna.platform.spring.SpiRegistryFactoryBean">
<property name="repository">
<ref bean="raven.repository" />
</property>
<property name="spiClassName"
value="org.apache.taverna.reference.h3.HibernateComponentClass" />
</bean>
</list>
</property>
</bean>
<bean id="t2reference.dao.referenceSetDao"
raven:artifact="org.apache.taverna.core:reference-impl:2.0.1-SNAPSHOT"
raven:repository="raven.repository"
class="org.apache.taverna.reference.impl.HibernateReferenceSetDao">
<property name="sessionFactory">
<ref local="t2reference.orm.h3.sessionFactory" />
</property>
</bean>
<bean id="t2reference.dao.errorDocumentDao"
raven:artifact="org.apache.taverna.core:reference-impl:2.0.1-SNAPSHOT"
raven:repository="raven.repository"
class="org.apache.taverna.reference.impl.HibernateErrorDocumentDao">
<property name="sessionFactory">
<ref local="t2reference.orm.h3.sessionFactory" />
</property>
</bean>
<bean id="t2reference.dao.listDao"
raven:artifact="org.apache.taverna.core:reference-impl:2.0.1-SNAPSHOT"
raven:repository="raven.repository"
class="org.apache.taverna.reference.impl.HibernateListDao">
<property name="sessionFactory">
<ref local="t2reference.orm.h3.sessionFactory" />
</property>
</bean>
</beans>