ibatis中的sqlMapConfig配置

ibatis中的sqlMapConfig配置


1.applicationContext.xml里配置:
	<bean id="sqlMapClient"
		class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
		<property name="configLocation">
			<value>classpath:ibatis/sqlMapConfig.xml</value>
		</property>
		<property name="dataSource">
			<ref bean="dataSource" />
		</property>
	</bean>



2.sqlMapConfig.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
	<settings
		cacheModelsEnabled="false"
		enhancementEnabled="true"
		lazyLoadingEnabled="true"
		errorTracingEnabled="true"
		maxRequests="32"
		maxSessions="10"
		maxTransactions="5"
		useStatementNamespaces="true"
	/>
	
	<typeAlias alias="item" type="com.lenovo.platform.core.data.impl.ItemImpl" />	
	<sqlMap resource="ibatis/example/ExamplePO.xml"/>
 	
</sqlMapConfig>



参考资料:
1. http://changyy-1988.iteye.com/blog/739025
2. http://blog.csdn.net/meiwenhui/article/details/4579071
3. http://zhaohe162.blog.163.com/blog/static/382167972011030101841848/


















你可能感兴趣的:(ibatis)