public RTTEventVo getRTTEventByPASCode(String code) { if (code == null) throw new DomainRuntimeException("Cannot get RTTEventVo for null PAS code"); DomainFactory factory = getDomainFactory(); RTTEvent result = RTTEvent.getRTTEventFromPASCode(factory, code); return RTTEventVoAssembler.create(result); }
private void saveRTT( EventVo event, EventRTTEventVoCollection rttToBeAdded, EventRTTEventVoCollection rttToBeDeteled, DomainFactory factory, Event domainRecord) throws StaleObjectException, ForeignKeyViolationException { // Save RTT if (rttToBeAdded != null) { for (int j = 0; j < rttToBeAdded.size(); j++) { EventRTTEvent domainRTT = EventRTTEventVoAssembler.extractEventRTTEvent(factory, rttToBeAdded.get(j)); RTTEvent rttEvent = (RTTEvent) domainRTT.getRTTEvent(); ; rttEvent.setUpperName(rttEvent.getName()); domainRTT.setEvent(domainRecord); if (domainRTT.getStatus().equals(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)) && domainRTT.getActivatedDateTime() == null) { domainRTT.setStatus(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE)); domainRTT.setActivatedBy(getUser()); domainRTT.setActivatedDateTime(new Date()); } else if (domainRTT .getStatus() .equals(getDomLookup(PreActiveActiveInactiveStatus.INACTIVE)) && domainRTT.getInactivatedDateTime() == null) { if (domainRTT.getInactivatedBy() == null) { domainRTT.setInactivatedBy(getUser()); domainRTT.setInactivatedDateTime(new Date()); } } factory.save(domainRTT); } } if (rttToBeDeteled != null) { for (int j = 0; j < rttToBeDeteled.size(); j++) { EventRTTEvent domainRTT = EventRTTEventVoAssembler.extractEventRTTEvent(factory, rttToBeDeteled.get(j)); factory.delete(domainRTT); } } }