比如select one等等方法,列举举个常用的,并说说作用
常用的:updateByExample、selectByPrimaryKey、selectByExample、insert、insertSelective、
deleteByPrimaryKey、deleteByExample ...基本上DAOImpl里的都用得上;
举个例子说明:
public List selectByExample(TUserExample example) {
List list = getSqlMapClientTemplate().queryForList("t_user.ibatorgenerated_selectByExample",example);
return list;
}
这个方法,是按指定的条件从表中查询数据。方法参数类型TUserExample,为封装了查询条件的类,查询条件会被传到**sqlMap.xml中的sql中,查询的一条条记录都会被封装成一个个的对象,然后放在一个List中返回给你。
deleteByPrimaryKey、deleteByExample ...基本上DAOImpl里的都用得上;
举个例子说明:
public List selectByExample(TUserExample example) {
List list = getSqlMapClientTemplate().queryForList("t_user.ibatorgenerated_selectByExample",example);
return list;
}
这个方法,是按指定的条件从表中查询数据。方法参数类型TUserExample,为封装了查询条件的类,查询条件会被传到**sqlMap.xml中的sql中,查询的一条条记录都会被封装成一个个的对象,然后放在一个List中返回给你。
温馨提示:答案为网友推荐,仅供参考
第1个回答 2013-05-28
resultMap 返回的实体类映射
sql 定义sql语句
include 引用
insert 插入
update - set修改
delete 删除
where 条件
if 判断
sql 定义sql语句
include 引用
insert 插入
update - set修改
delete 删除
where 条件
if 判断
第2个回答 2018-02-07
你可以看看