GlueMyBatis를 사용하기 위한 필요 요소
DAO, SQLSession, SessionFactory 의 정의 (applicationContext.xml)
<bean id="test-dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${sqlite.test-dataSource.driverClassName}"/> <property name="url" value="${sqlite.test-dataSource.url}"/> <property name="defaultAutoCommit" value="false"/> <property name="minIdle" value="0"/> <property name="maxTotal" value="-1"/> <property name="maxIdle" value="1000"/> </bean> <bean id="test-dao" class="com.poscoict.glueframework.dao.mybatis.GlueMybatisDao"> <property name="sqlSession" ref="sqlSession" /> </bean> <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg index="0" ref="sqlSessionFactory" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="test-dataSource" /> <property name="mapperLocations" value="classpath*:mybatis/mapper/*.xml" /> </bean>
SQL mapper
VO
Activity (GlueMybatisInsert/Modity/Delete activity)
Sample 사용법
http://WAS ip:WAS port/sample-mybatis/
접속