首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

ibatis利用spring对其支持配备

2012-11-09 
ibatis利用spring对其支持配置bean idsqlMapClient//property/beanbean idbaseDao//proper

ibatis利用spring对其支持配置

  <bean id="sqlMapClient"        />    </property>    </bean>  <bean id="baseDao"        />    </property>          </bean>

?上述是spring配置文件

?下面是basedao类

?

import javax.sql.DataSource;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.springframework.orm.hibernate3.support.HibernateDaoSupport;import org.springframework.orm.ibatis.SqlMapClientTemplate;import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;import com.ibatis.sqlmap.client.SqlMapClient;public class BaseDao extends SqlMapClientDaoSupport{    }

?

其他类如何使用这个basedao呢?applicationContext.xml配置如下。

<bean  id="hrDao"  parent="baseDao"></bean>

?

热点排行