PageRenderTime 19ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/alaspatial/src/main/webapp/WEB-INF/spring/hibernate-config.xml

http://alageospatialportal.googlecode.com/
XML | 52 lines | 39 code | 6 blank | 7 comment | 0 complexity | b3f1e97a4e20bb47f60eb4642732e13b MD5 | raw file
 1<?xml version="1.0" encoding="UTF-8"?>
 2<beans xmlns="http://www.springframework.org/schema/beans"
 3       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4       xmlns:mvc="http://www.springframework.org/schema/mvc"
 5       xsi:schemaLocation="
 6       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 7       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
 8
 9    <!-- org.apache.commons.dbcp.BasicDataSource -->
10    <bean id="myDataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
11        <property name="driverClassName" value="org.postgresql.Driver"/>
12        <property name="url" value="jdbc:postgresql://localhost/spatialdb:5432"/>
13        <property name="username" value="enterprisedb"/>
14        <property name="password" value="postgres"/>
15    </bean>
16
17    <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
18        <property name="dataSource" ref="myDataSource" />
19        <property name="annotatedClasses">
20            <list>
21                <value>org.ala.spatial.domain.Species</value>
22                <value>org.ala.spatial.domain.TaxonNames</value>
23            </list>
24        </property>
25        <property name="hibernateProperties">
26            <props>
27                <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
28                <prop key="hibernate.show_sql">true</prop>
29                <!-- <prop key="hibernate.hbm2ddl.auto">create</prop> -->
30
31                <prop key="hibernate.c3p0.min_size">5</prop>
32                <prop key="hibernate.c3p0.max_size">80</prop>
33                <prop key="hibernate.c3p0.initial_pool_size">5</prop>
34                <prop key="hibernate.c3p0.min_pool_size">15</prop>
35                <prop key="hibernate.c3p0.max_pool_size">25</prop>
36                <prop key="hibernate.c3p0.timeout">1800</prop>
37                <prop key="hibernate.c3p0.max_statements">50</prop>
38            </props>
39        </property>
40    </bean>
41
42    <bean id="speciesDao" class="org.ala.spatial.dao.SpeciesDAOImpl">
43        <property name="sessionFactory" ref="mySessionFactory"/>
44    </bean>
45
46    <!--
47    <bean id="namesDao" class="org.ala.spatial.dao.TaxonNamesDAOImpl">
48        <property name="sessionFactory" ref="mySessionFactory"/>
49    </bean>
50    -->
51
52</beans>