错误提示:Malformed OGNL expression: beginTime != null and beginTime !=''
org.apache.ibatis.ognl.TokenMgrError: Lexical error at line 1, column 22.
这个异常我怎么也改不出来
另外还有个疑问,map返回值应该怎么写?代码如下,
//图形统计
public Map<String, Object> userGraph(Map<String, Object> map){
try {
super.sqlSessionTemplate.selectList("com.kinglo.im.pojo.User.userGraph",map);
// super.sqlSessionTemplate.selectMap("com.kinglo.im.pojo.User.userGraph", map);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
问题1同意楼上的。
问题2:
如果是返回Map对象
//图形统计 public Map<String, Object> userGraph(Map<String, Object> map){ try { //super.sqlSessionTemplate.selectList("com.kinglo.im.pojo.User.userGraph",map); super.sqlSessionTemplate.selectMap("com.kinglo.im.pojo.User.userGraph", map); } catch (Exception e) { e.printStackTrace(); } return null; }
如果是返回Map集合
//图形统计 public List<Map<String, Object>> userGraph(Map<String, Object> map){ try { //super.sqlSessionTemplate.selectList("com.kinglo.im.pojo.User.userGraph",map); super.sqlSessionTemplate.selectMap("com.kinglo.im.pojo.User.userGraph", map); } catch (Exception e) { e.printStackTrace(); } return null; }
另外,super.sqlSessionTemplate.selectList("com.kinglo.im.pojo.User.userGraph",map);返回的是List<Object>
这个key指的是啥。。。
@根目录97: 你可以在项目里运行一下看看吗?谢谢了,我这问题没解决
@根目录97:
不好意思,现在不是做java开发的,演示不了。
sqlSessionTemplate.selectMap("com.kinglo.im.pojo.User.userGraph", map, key);
selectMap方法返回指定列为key的map集合或对象,它的value值得类型可以为Object或map
@SeayXu: 好,谢谢你了
beginTime != null and beginTime !='' 可能是第2个beginTime之前的中文全角空格引起的
谢谢 非常感谢
当时我就吓傻了,真的点进来看,发现并没有标题那么夸张...
根据这种错误信息,数到第22个字符,就是你的全角空格。
标题真的不好意思,我悬赏100都没人帮我,不得已出的这样下策呀
@根目录97: 话说,昨天就看到了。不过看到标题那么吓人,当时就没敢点进来........
@幻天芒: 嗯,这是我第一次为我的不细心(一个空格)付出了惨重代价,修改两天,请教总监两次,都没给我看,也都无所谓了,总监出bug,我也不给他看,哈哈