while(iter.hasNext()){ Summary summary2 = (Summary) iter.next(); if((summary2.getSummaryDate().equals(summaryDate)) && (summary2.getSummaryHour().equals(summaryHour))) summary = summary2; }
if(shift != null){ List summaries = shift.getAssociatedSummaries(); Iterator iter = summaries.iterator(); while(iter.hasNext()){ Summary summary2 = (Summary) iter.next(); if((summary2.getSummaryDate().equals(summaryDate)) && (summary2.getSummaryHour().equals(summaryHour))) summary = summary2; } }
    public ISummary readSummaryByUnique(final Integer shiftID, Date summaryDate, Date summaryHour)    throws ExcepcaoPersistencia {                        final IShift shift = (IShift) readByOID(Shift.class, shiftID);        List summaries = shift.getAssociatedSummaries();        Iterator iter = summaries.iterator();        ISummary summary = null;                while(iter.hasNext()){            Summary summary2 = (Summary) iter.next();            if((summary2.getSummaryDate().equals(summaryDate)) && (summary2.getSummaryHour().equals(summaryHour)))                summary = summary2;                    }                return summary;    }