0
回答
从数据库中获取的数据,被第一条数据的id覆盖
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   
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";
}
<无标签>
举报
___照g
发帖于3年前 0回/126阅
顶部