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

	<!-- 配置数据源 -->
	<bean id="dingding.dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
		<property name="driverClass" value="${dingding.jdbc.driver}" />
		<property name="url" value="${dingding.jdbc.url}" />
		<property name="username" value="${dingding.jdbc.username}" />
		<property name="password" value="${dingding.jdbc.password}" />
	</bean>
	<!-- 配置hibernate -->
	<bean id="dingding.sessionFactory" class="cn.com.yict.framemax.data.hibernate.Hibernate4LocalSessionFactoryBean">
		<property name="dataSource" ref="dingding.dataSource" />
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">true</prop>
				<prop key="hibernate.use_sql_comments">true</prop>
				<prop key="hibernate.id.new_generator_mappings">false</prop>
				<prop key="hibernate.jdbc.batch_size">100</prop>
				<prop key="hibernate.order_inserts">true</prop>
				<prop key="hibernate.order_updates">true</prop>
				<prop key="hibernate.cache.use_second_level_cache">false</prop>
				<prop key="hibernate.cache.use_query_cache">false</prop>
			</props>
		</property>
		<property name="mappingClassesRegistration" ref="dingding.mappingClassRegistration" />
	</bean>	
	<!-- 配置hibernate的实体映射 -->
	<bean id="dingding.mappingClassRegistration" class="cn.com.yict.framemax.data.MappingClassesRegistration">
		<property name="packages">
			<list>
				<value>cn.com.yict.fmx.demo.dingding.model</value>
				<value>cn.com.yict.fmx.demo.dingding.query</value>
			</list>
		</property>
	</bean>
	<!-- 配置事务管理器 -->
	<bean id="dingding.transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="dingding.sessionFactory" />
	</bean>	
</beans>
