标签:on() session from forum ring order by get rom param
query.setFirstResult(0),query.setMaxResults(1);相当于MySQL中的limit 0, 1;
String hql = "FROM Forum f WHERE f.position < ? ORDER BY f.position DESC";
Query query = this.getSession().createQuery(hql);
query.setParameter(0, p1);
query.setFirstResult(0);
query.setMaxResults(1);
Forum forum2 = (Forum) query.uniqueResult();
query.setFirstResult(0),query.setMaxResults(4)
标签:on() session from forum ring order by get rom param
原文地址:https://www.cnblogs.com/zhaoleigege/p/8970458.html