从数据库中获取的数据,被第一条数据的id覆盖

___照g 发布于 2014/11/18 14:12
阅读 132
收藏 0
String hql = "from Heading h where h.id=? ";

List<Long> hid1=new ArrayList<Long>();
hid1.add(1L);
hid1.add(2L);
hid1.add(3L);
Long[] hid=new Long[]{1L,2L,3L};
Object[] value = { hid};
List list = commonManager.getList(hql, new Object[]{1L,2L,3L});



hql = "from News where hid=1 and rownum<=5";
list = new ArrayList();
list=commonManager.getList(hql, null);
hsTmp.put("ptc1", list);

hql = "from News where hid=2 and rownum<=5";
list = new ArrayList();
list=commonManager.getList(hql, null);
hsTmp.put("ptc2", list);

hql = "from News h where hid=3 and rownum<=5";
list = new ArrayList();
list=commonManager.getList(hql, null);
hsTmp.put("ptc3", list);

return "preList";
}
加载中
返回顶部
顶部