<?xml version="1.0" encoding="UTF-8"?>
<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 http://www.springframework.org/schema/beans/spring-beans.xsd">

    <!--<bean id="sessionFactory" class="org.flume.alarm.core.hibernate.RecoverableSessionFactoryBean">-->
        <!--<property name="dataSource" ref="dataSource"/>-->
        <!--<property name="packagesToScan" value="${application.domain.packages}"/>-->
        <!--<property name="hibernateProperties" ref="applicationProperties"/>-->
    <!--</bean>-->


    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="${db.default.driverClassName}"/>
        <property name="url" value="${db.default.url}"/>
        <property name="username" value="${db.default.username}"/>
        <property name="password" value="${db.default.password}"/>
        <property name="initialSize" value="5" />
        <property name="maxActive" value="10" />
        <property name="validationQuery" value="select 1" />
        <property name="testOnBorrow" value="true" />
        <property name="validationQueryTimeout" value="10" />
    </bean>
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
        <property name="dataSource" ref="dataSource"/>
    </bean>


    <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
                <!--<prop key="hibernate.hbm2ddl.auto">update</prop>-->
                <prop key="hibernate.show_sql">false</prop>
                <prop key="hibernate.format_sql">false</prop>
            </props>
        </property>


        <property name="packagesToScan" value="${application.domain.packages}"/>

        <!--<property name="annotatedClasses">-->
            <!--<list>-->
                <!--<value>org.flume.alarm.domain.Liquid</value>-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.user.domain.Company</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.user.domain.Role</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.marker.domain.Marker</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.task.domain.Task</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.task.domain.TaskDetail</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.task.domain.Position</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.event.domain.Event</value>&ndash;&gt;-->
                <!--&lt;!&ndash;<value>com.casic.accessControl.marker.domain.OptionItem</value>&ndash;&gt;-->
            <!--</list>-->
        <!--</property>-->
    </bean>

    <bean id="transactionManager" class="org.well.well.core.hibernate.ReadOnlyTransactionManager">
        <property name="platformTransactionManager">
            <bean class="org.springframework.orm.hibernate4.HibernateTransactionManager">
                <property name="sessionFactory" ref="sessionFactory"/>
            </bean>
        </property>
    </bean>

</beans>
