2012-11-01 23:29:18 -03:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2012-11-04 01:06:02 -03:00
|
|
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
|
|
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
|
|
|
http://www.springframework.org/schema/context
|
|
|
|
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
|
|
|
|
|
2012-11-01 23:29:18 -03:00
|
|
|
<bean id="wiseDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
|
|
|
<property name="driverClassName" value="${database.driver}"/>
|
|
|
|
<property name="url" value="${database.url}"/>
|
|
|
|
<property name="username" value="${database.username}"/>
|
|
|
|
<property name="password" value="${database.password}"/>
|
|
|
|
<property name="testOnBorrow" value="${database.validation.enabled}"/>
|
|
|
|
<property name="validationQuery" value="${database.validation.query}"/>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<!--Descoment this lines for production environments -->
|
|
|
|
<!--<bean id="wiseDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">-->
|
|
|
|
<!--<property name="jndiName">-->
|
|
|
|
<!--<value>java:comp/env/jdbc/wisemapping</value>-->
|
|
|
|
<!--</property>-->
|
|
|
|
<!--</bean>-->
|
|
|
|
|
|
|
|
<bean id="mindmapSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
|
|
|
<property name="dataSource" ref="wiseDataSource"/>
|
|
|
|
<property name="mappingResources">
|
|
|
|
<list>
|
|
|
|
<value>com/wisemapping/model/Collaborator.hbm.xml</value>
|
|
|
|
<value>com/wisemapping/model/Mindmap.hbm.xml</value>
|
|
|
|
<value>com/wisemapping/model/Collaboration.hbm.xml</value>
|
|
|
|
<value>com/wisemapping/model/CollaborationProperties.hbm.xml</value>
|
|
|
|
<value>com/wisemapping/model/AccessAuditory.hbm.xml</value>
|
|
|
|
<value>com/wisemapping/model/MindMapHistory.hbm.xml</value>
|
|
|
|
</list>
|
|
|
|
</property>
|
|
|
|
<property name="hibernateProperties">
|
|
|
|
<props>
|
|
|
|
<prop key="hibernate.dialect">${database.hibernate.dialect}</prop>
|
|
|
|
</props>
|
|
|
|
</property>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
|
|
|
<property name="sessionFactory">
|
|
|
|
<ref local="mindmapSessionFactory"/>
|
|
|
|
</property>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<!-- Spring Data Access Exception Translator Defintion -->
|
|
|
|
<bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator">
|
|
|
|
<property name="dataSource" ref="wiseDataSource"/>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<!-- Hibernate Template Defintion -->
|
|
|
|
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
|
|
|
|
<property name="sessionFactory" ref="mindmapSessionFactory"/>
|
|
|
|
<property name="jdbcExceptionTranslator" ref="jdbcExceptionTranslator"/>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<bean id="txAttributes"
|
|
|
|
class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
|
|
|
|
<property name="properties">
|
|
|
|
<props>
|
|
|
|
<prop key="*">PROPAGATION_REQUIRED</prop>
|
|
|
|
</props>
|
|
|
|
</property>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
<bean id="txInterceptor"
|
|
|
|
class="org.springframework.transaction.interceptor.TransactionInterceptor">
|
|
|
|
<property name="transactionManager" ref="transactionManager"/>
|
|
|
|
<property name="transactionAttributeSource" ref="txAttributes"/>
|
|
|
|
</bean>
|
|
|
|
|
|
|
|
</beans>
|