/** * listDocuments */ public ims.admin.vo.PrintAgentDocumentsVoCollection listDocuments(Integer jobId, ims.framework.utils.DateTime startDate, ims.framework.utils.DateTime endDate) { DomainFactory factory = getDomainFactory(); List list = factory.find("from PrintAgentDocuments pad where pad.printAgent.id = :ID and pad.systemInformation.creationDateTime between :DATE1 and :DATE2 order by pad.systemInformation.creationDateTime desc", new String[] {"ID", "DATE1", "DATE2"}, new Object[] {jobId, startDate.getJavaDate(), endDate.getJavaDate()}); PrintAgentDocumentsVoCollection coll = PrintAgentDocumentsVoAssembler.createPrintAgentDocumentsVoCollectionFromPrintAgentDocuments(list); for(int i = 0; i < coll.size(); i++) { Iterator it = list.iterator(); while(it.hasNext()) { PrintAgentDocuments obj = (PrintAgentDocuments)it.next(); if(coll.get(i).getID_PrintAgentDocuments().equals(obj.getId())) { coll.get(i).setLastUpdateDateTime(new DateTime(obj.getSystemInformation().getCreationDateTime())); break; } } } return coll.sort(SortOrder.DESCENDING); }