<?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-3.1.xsd">

	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="typeAliasesPackage" value="com.**.entity;" />
		<property name="mapperLocations" value="classpath*:com/**/mapper/*.xml" />
		<property name="dataSource" ref="dataSource" />
		<property name="configLocation" value="classpath:config/mybatis-config.xml" />
	</bean>

	<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		<property name="basePackage" value="com.**.mapper" />
		<property name="sqlSessionTemplateBeanName" value="sqlSessionTemplate"/>
	</bean>

	<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate" destroy-method="clearCache">
		<constructor-arg index="0" ref="sqlSessionFactory" />
	</bean>

	<bean id="mybatisDao" class="com.xmomen.framework.mybatis.dao.impl.MybatisDaoImpl">
		<property name="sqlSessionTemplate" ref="sqlSessionTemplate" />
	</bean>

</beans>