public WheelchairCushionVoCollection listByCareContext(CareContextRefVo refCareContext) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from WheelchairCushion w "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (refCareContext != null) { hql.append(andStr + " w.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(refCareContext.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List cushions = factory.find(query, markers, values); WheelchairCushionVoCollection collWheelchairCushion = WheelchairCushionVoAssembler.createWheelchairCushionVoCollectionFromWheelchairCushion(cushions); return collWheelchairCushion; }
/** * populates the screen from data from specified WheelchairCushionVoCollection * @param collWheelchairCushionVo * @return void */ private void populateListControl(WheelchairCushionVoCollection collWheelchairCushionVo) { clear(); if (collWheelchairCushionVo != null) { GenForm.grdDetailsRow row; for (int i =0; i < collWheelchairCushionVo.size();i++) { row = form.grdDetails().getRows().newRow(); row.setValue(collWheelchairCushionVo.get(i)); if(collWheelchairCushionVo.get(i).getAuthoringDateTimeIsNotNull()) row.setColDate(collWheelchairCushionVo.get(i).getAuthoringDateTime().toString()); if(collWheelchairCushionVo.get(i).getAuthoringCPIsNotNull()) row.setColHCP(collWheelchairCushionVo.get(i).getAuthoringCP().toString()); if(collWheelchairCushionVo.get(i).getCushionCategoryIsNotNull()) row.setColCategory(collWheelchairCushionVo.get(i).getCushionCategory().toString()); if(collWheelchairCushionVo.get(i).getCushionTypeIsNotNull()) row.setColType(collWheelchairCushionVo.get(i).getCushionType().toString()); if(collWheelchairCushionVo.get(i).getCoverTypeIsNotNull()) row.setColCoverType(collWheelchairCushionVo.get(i).getCoverType().toString()); if(collWheelchairCushionVo.get(i).getCushionSizeIsNotNull()) row.setColCushionSize(collWheelchairCushionVo.get(i).getCushionSize().toString()); if(collWheelchairCushionVo.get(i).getStartDateIsNotNull()) row.setColStartDate(collWheelchairCushionVo.get(i).getStartDate().toString()); if(collWheelchairCushionVo.get(i).getEndDateIsNotNull()) row.setColEndDate(collWheelchairCushionVo.get(i).getEndDate().toString()); } } }