<beans>
<!--**** Start of PERSISTENCE DEFINITIONS ****-->
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>init.properties</value>
</property>
</bean>
<!-- JDBC Connection -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>${datasource.driverClassName}</value>
</property>
<property name="url">
<value>${datasource.url}</value>
</property>
<property name="username">
<value>${datasource.username}</value>
</property>
<property name="password">
<value>${datasource.password}</value>
</property>
<property name="maxActive">
<value>${datasource.maxActive}</value>
</property>
<property name="maxIdle">
<value>${datasource.maxIdle}</value>
</property>
<property name="maxWait">
<value>${datasource.maxWait}</value>
</property>
<property name="defaultAutoCommit">
<value>${datasource.defaultAutoCommit}</value>
</property>
</bean>
<!--**** OracleLobHandler ****-->
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler">
<property name="nativeJdbcExtractor">
<ref local="nativeJdbcExtractor"/>
</property>
</bean>
<bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"></bean>
<!--**** SessionFactory Definition ****-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="lobHandler">
<ref bean="oracleLobHandler" />
</property>
<property name="mappingResources">
<list>
<value>com\wonders\pubinfo\bean\LawInfo.hbm.xml</value>
<value>com\wonders\pubinfo\bean\LawType.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
</props>
</property>
</bean>
</beans> |