71 lines
3.3 KiB
XML
Raw Normal View History

<?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"
xsi:schemaLocation="http://www.springframework.org/schema/beans
2020-11-07 11:56:38 -08:00
http://www.springframework.org/schema/beans/spring-beans.xsd">
2012-11-04 01:06:02 -03:00
<bean id="wiseDataSource" class="org.apache.commons.dbcp2.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>
<!--Uncomment this lines for production environments -->
<!--<bean id="wiseDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">-->
2020-11-07 11:56:38 -08:00
<!--<property name="jndiName">-->
<!--<value>java:comp/env/jdbc/wisemapping</value>-->
<!--</property>-->
<!--</bean>-->
2020-11-07 11:56:38 -08:00
<bean id="mindmapSessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="wiseDataSource"/>
<property name="annotatedClasses">
<list>
<value>com.wisemapping.model.User</value>
<value>com.wisemapping.model.Collaborator</value>
<value>com.wisemapping.model.Collaboration</value>
<value>com.wisemapping.model.Mindmap</value>
<value>com.wisemapping.model.Label</value>
<value>com.wisemapping.model.CollaborationProperties</value>
<value>com.wisemapping.model.AccessAuditory</value>
<value>com.wisemapping.model.MindMapHistory</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${database.hibernate.dialect}</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
2022-01-22 09:40:47 -08:00
<prop key="hibernate.default_batch_fetch_size">200</prop>
</props>
</property>
</bean>
2020-11-07 11:56:38 -08:00
<bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
<property name="sessionFactory" ref="mindmapSessionFactory"/>
</bean>
2013-03-28 12:28:53 -03:00
<!-- Hibernate Template Definition -->
2020-11-07 11:56:38 -08:00
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate5.HibernateTemplate">
<property name="sessionFactory" ref="mindmapSessionFactory"/>
</bean>
<bean id="txAttributes"
class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
<property name="properties">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
2020-11-07 11:56:38 -08:00
<bean id="txInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributeSource" ref="txAttributes"/>
</bean>
</beans>