public UIPageResponse search(UIPage page,Map<String, String> params){
Page _page = page.toPage();
try {
applyLoanService.getList(_page,params);
} catch (Exception e) {
e.printStackTrace();
}
if(_page.getmList==null){
System.out.println("为空");
}
}
public Page getList(Page page, Map<String, String> params) throws Exception {
useDefaultDao();
StringBuffer sb = new StringBuffer();
List<String> sqlParams = new ArrayList<String>();
sb.append(" SELECT * ").append(" FROM applyloan ").append(" WHERE 1=1 ");
try{
dataDao.queryMap(page, sb.toString(), sqlParams.toArray());
}catch (Exception e) {
throw new Exception("getList()查询异常,描述:" + e.toString());
}
if(page.getmList!=null){
System.out.println("不为空");
}
return page;
}
结果是这两句话都能输出.
为什么我把_page作为一个引用类型传递到getList()方法,按照引用类型址传递,最后返回的page对象在search()方法即使应该没用_page = applyLoanService.getList(_page,params); 也应该会被改变才对,不是这样的吗.?
LEATH
烙印99
相关分类