crit.addOrderBy("number", true); List reimbursementGuides = queryList(ReimbursementGuide.class,crit); if (reimbursementGuides!=null) {
crit.addOrderBy("number", false); List reimbursementGuides = queryList(ReimbursementGuide.class, crit);  if (reimbursementGuides != null && !reimbursementGuides.isEmpty()) { System.out.println("guides->" + reimbursementGuides.size());
    public Integer generateReimbursementGuideNumber() throws ExcepcaoPersistencia    {        Integer reimbursementGuideNumber = new Integer(1);        Criteria crit = new Criteria();        crit.addOrderBy("number", true);        List reimbursementGuides = queryList(ReimbursementGuide.class,crit);        if (reimbursementGuides!=null) {            IReimbursementGuide reimbursementGuide = (IReimbursementGuide) reimbursementGuides.get(0);            reimbursementGuideNumber = new Integer(reimbursementGuide.getNumber().intValue()+1);        }        return reimbursementGuideNumber;    }