制定查询条数

        String hql ="select j from JfAuction j where 1=1 ";
        hql+=" and j.jfEvent.id =";
        hql+=jfEventId;
        hql+=" order by j.score desc ";
        Query query = jfAuctionDao.getSession().createQuery(hql);
        query.setFirstResult(0);
        query.setMaxResults(100);
        List<JfAuction> jfAuctionList=query.list();

posted @ 2015-01-12 14:06  紫发少年  阅读(128)  评论(0编辑  收藏  举报