首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

Mybatis 多个参数的传到

2012-09-07 
Mybatis 多个参数的传入Mybatis 在传入多个参数的时候,可以选择传map对象,也可以选择定义接口?1,传map对象

Mybatis 多个参数的传入

Mybatis 在传入多个参数的时候,可以选择传map对象,也可以选择定义接口

?

1,传map对象:

public int updateByExampleSelective(Section record, SectionCriteria example) {SqlSession session=sessionFactory.openSession();SectionMapper  sectionMapper=session.getMapper(SectionMapper.class);int  result=sectionMapper.updateByExampleSelective(record, example);session.commit();session.close();return result;}

?以上两种方式都能解决传入多个对象问题。

?

?

?

热点排行