public ApproveInfo getLastApproveInfo(int documentId) {
 String hql="select app from ApproveInfo app where app.document.id =? order by id DESC";
return(ApproveInfo)getSession().createQuery(hql).setParameter(0, documentId).setMaxResults(1);
 
}以上是我写的hql 语句 ,我想根据where 条件得到最后一个ApproveInfo对象!
  而在hibernate 中不可以使用limit !
我改成setMaxResults(1),还是不可以!怎么做比较好!