<?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:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd 
	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd			
	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

	<!-- mybatis 연동과 관련하여 연동 환경 정의 및 SQL Query Map 파일 정의 -->
	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configLocation" value="classpath:com/terry/xplatform/resources/mybatis/config/mybatis-config.xml" /> <!-- mybatis 연동 환경 정의 -->
        <property name="mapperLocations"> <!-- mybatis 쿼리 맵들이 있는 경로 -->
            <list>
                <value>classpath:com/terry/xplatform/resources/mybatis/mapper/*.xml</value>
            </list>
        </property>
    </bean>
    
    <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
        <qualifier value="sqlSession" />
        <constructor-arg index="0" ref="sqlSessionFactory" />
    </bean>

    <bean id="sqlBatchSession" class="org.mybatis.spring.SqlSessionTemplate">
        <qualifier value="sqlBatchSession" />
        <constructor-arg index="0" ref="sqlSessionFactory" />
        <constructor-arg index="1" value="BATCH" />
    </bean>
			
</beans>	
