public DrawingGraphicFindingQuestionVoCollection saveDrawingGraphicFindings(DrawingGraphicFindingQuestionVoCollection voColl) throws StaleObjectException { if(voColl == null) throw new RuntimeException("Cannot save null values for DrawingGraphicFindingQuestionVoCollection"); if(voColl.isValidated() == false) throw new CodingRuntimeException("DrawingGraphicFindingQuestionVoCollection has not been validated"); DomainFactory factory = getDomainFactory(); ArrayList doList = new ArrayList(); for(int i=0; i<voColl.size(); i++) { DrawingGraphicFindingQuestion doDrawingGraphicFindingQuestion = DrawingGraphicFindingQuestionVoAssembler.extractDrawingGraphicFindingQuestion(factory, voColl.get(i)); factory.save(doDrawingGraphicFindingQuestion); doList.add(doDrawingGraphicFindingQuestion); } return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(doList); }
public DrawingGraphicFindingQuestionVo saveDrawingGraphicFinding(DrawingGraphicFindingQuestionVo voDrawingGraphicFindingQuestion) throws StaleObjectException { if(voDrawingGraphicFindingQuestion == null) throw new RuntimeException("Cannot save null value for DrawingGraphicFindingQuestionVo"); if(voDrawingGraphicFindingQuestion.isValidated() == false) throw new CodingRuntimeException("DrawingGraphicFindingQuestion Value Object has not been validated"); DomainFactory factory = getDomainFactory(); DrawingGraphicFindingQuestion doDrawingGraphicFindingQuestion = DrawingGraphicFindingQuestionVoAssembler.extractDrawingGraphicFindingQuestion(factory, voDrawingGraphicFindingQuestion); DrawingGraphicFinding doDrawingGraphicFinding = DrawingGraphicFindingVoAssembler.extractDrawingGraphicFinding(factory, voDrawingGraphicFindingQuestion.getDrawingGraphicFinding()); factory.save(doDrawingGraphicFinding); doDrawingGraphicFindingQuestion.setDrawingGraphicFinding(doDrawingGraphicFinding); factory.save(doDrawingGraphicFinding); return DrawingGraphicFindingQuestionVoAssembler.create(doDrawingGraphicFindingQuestion); }
/** * List active finding questions */ public DrawingGraphicFindingQuestionVoCollection listDrawingGraphicFindings(Integer findingId) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("select dgfq from DrawingGraphicFindingQuestion as dgfq left join dgfq.question as dgql where (dgfq.drawingGraphicFinding.id = :findID and dgql.status.id != :statusID) order by dgfq.order asc "); //wdev-10987 ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); names.add("findID"); values.add(findingId); names.add("statusID"); values.add(getDomLookup(PreActiveActiveInactiveStatus.INACTIVE).getId()); List findingsList = factory.find(hql.toString(), names, values); return DrawingGraphicFindingQuestionVoAssembler.createDrawingGraphicFindingQuestionVoCollectionFromDrawingGraphicFindingQuestion(findingsList); }