public EventVo getEvent(EventRefVo voRef) { if (voRef == null) throw new DomainRuntimeException("Cannot get EventVo for null EventRefVo"); DomainFactory factory = getDomainFactory(); Event doEvent = (Event) factory.getDomainObject(Event.class, voRef.getID_Event()); return EventVoAssembler.create(doEvent); }
public EventVo save( EventVo event, EventTargetVoCollection eventTargets, EventExternalEventMappingVoCollection externalToBeAdded, EventExternalEventMappingVoCollection externalToBeDeleted, EventRTTEventVoCollection rttToBeAdded, EventRTTEventVoCollection rttToBeDeteled) throws StaleObjectException, ForeignKeyViolationException, UniqueKeyViolationException, DomainInterfaceException { if (event == null) { throw new DomainRuntimeException("Invalid record"); } if (!event.isValidated()) { throw new CodingRuntimeException("Record not validated"); } // CheckForUniq checkForUniqRecords(event, externalToBeAdded, rttToBeAdded); DomainFactory factory = getDomainFactory(); if (eventTargets != null) { event.setEventTargets(eventTargets.toIRecordStatusTreeArray()); } RecordStatusValidator helper = new RecordStatusValidator(factory, getLookupService()); helper.validate(event); // Save Event Event domainRecord = EventVoAssembler.extractEvent(factory, event); if (domainRecord.getName() != null) { domainRecord.setUpperName(domainRecord.getName().toUpperCase()); } factory.save(domainRecord); event = EventVoAssembler.create(domainRecord); // Save External saveExternal(event, externalToBeAdded, externalToBeDeleted, factory, domainRecord); // Save RTT saveRTT(event, rttToBeAdded, rttToBeDeteled, factory, domainRecord); // Save Targets saveTargets(event, eventTargets, factory); return EventVoAssembler.create(domainRecord); }