DAO层
public List GetByProperty(String property, Object value, String orderby,
int size) throws Exception {
List list = null;
try {
list = this.getSession().createCriteria(HLivingSkill.class).add(
Expression.eq(property, value)).addOrder(
Order.desc(orderby)).setMaxResults(size).list();
} catch (Exception ex) {
throw new Exception(ex);
}
return list;
}
serivce 层
public List getLivingSkillByGuanzhu(int size) throws Exception {
// TODO Auto-generated method stub
return this.livingSkillDAO.GetByProperty("status",
HConstants.CEM_HUIGOU_STATUS_WAIT, "visitCount", size);
}
按访问量visitCount排序,为什么取出来的值没有按访问量visitCount 排序(desc)
???
public List GetByProperty(String property, Object value, String orderby,
int size) throws Exception {
List list = null;
try {
list = this.getSession().createCriteria(HLivingSkill.class).add(
Expression.eq(property, value)).addOrder(
Order.desc(orderby)).setMaxResults(size).list();
} catch (Exception ex) {
throw new Exception(ex);
}
return list;
}
serivce 层
public List getLivingSkillByGuanzhu(int size) throws Exception {
// TODO Auto-generated method stub
return this.livingSkillDAO.GetByProperty("status",
HConstants.CEM_HUIGOU_STATUS_WAIT, "visitCount", size);
}
按访问量visitCount排序,为什么取出来的值没有按访问量visitCount 排序(desc)
???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货