public TrackingForTrackingStatusVo getTracking(TrackingRefVo tracking) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (tracking == null || !tracking.getID_TrackingIsNotNull()) { throw new CodingRuntimeException("Cannot get Tracking on null TrackingId "); } StringBuffer hql = new StringBuffer(); hql.append(" select Tracking from Tracking as Tracking where Tracking.id = :trackingID"); markers.add("trackingID"); values.add(tracking.getID_Tracking()); return TrackingForTrackingStatusVoAssembler.createTrackingForTrackingStatusVoCollectionFromTracking(factory.find(hql.toString(), markers, values)).get(0); }
private boolean save() { TrackingAttendanceStatusVo trackingAttendanceStatus = populateDataFromScreen(); TrackingForTrackingStatusVo TrackingToSave = form.getLocalContext().getselectedTracking(); TrackingToSave.setCurrentStatus(trackingAttendanceStatus); String[] errors = TrackingToSave.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { domain.saveTracking(TrackingToSave); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } return true; }
public void saveTracking(ims.emergency.vo.TrackingForTrackingStatusVo trackingToSave) throws ims.domain.exceptions.StaleObjectException { if (trackingToSave == null) throw new CodingRuntimeException("Cannot save null TrackingForTrackingStatusVo "); if (!trackingToSave.isValidated()) throw new DomainRuntimeException("TrackingForTrackingStatusVo Not Validated."); DomainFactory factory = getDomainFactory(); Tracking domainTrackingStatus = TrackingForTrackingStatusVoAssembler.extractTracking(factory, trackingToSave); factory.save(domainTrackingStatus); }