1、spring配置文件中增加以下代码
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:conf/ibatis/sqlmap-config.xml"/>
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="xxxxx" class="xxxxxx">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
2、ibatis配置文件sqlmap-config.xml中引入具体的ibatis配置文件即可
<sqlMap resource="conf/ibatis/ibatis.xxx.xml" />
3、所有dao类都继承com.ibatis.sqlmap.client.SqlMapClient
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:conf/ibatis/sqlmap-config.xml"/>
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="xxxxx" class="xxxxxx">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
2、ibatis配置文件sqlmap-config.xml中引入具体的ibatis配置文件即可
<sqlMap resource="conf/ibatis/ibatis.xxx.xml" />
3、所有dao类都继承com.ibatis.sqlmap.client.SqlMapClient