@Override public Long getId() { return arrayRun.getId(); }
@Override public boolean isSaved() { return getId() != UNSAVED_ID; }
@Override public long save(ArrayRun arrayRun) throws IOException { loadChildEntities(arrayRun); if (arrayRun.getId() == ArrayRun.UNSAVED_ID) { return create(arrayRun); } else { return update(arrayRun); } }
private long update(ArrayRun arrayRun) throws IOException { ArrayRun managed = get(arrayRun.getId()); validateChange(arrayRun, managed); applyChanges(arrayRun, managed); managed.setChangeDetails(authorizationManager.getCurrentUser()); return arrayRunStore.save(managed); }
List<ValidationError> errors = new ArrayList<>(); if (arrayRun.getId() != ArrayRun.UNSAVED_ID && beforeChange == null) { errors.add(new ValidationError("Array Run not found"));
public static ArrayRunDto asDto(@Nonnull ArrayRun from) { ArrayRunDto dto = new ArrayRunDto(); dto.setId(from.getId()); dto.setAlias(from.getAlias()); dto.setDescription(from.getDescription()); dto.setFilePath(from.getFilePath()); if (from.getInstrument() != null) { dto.setInstrumentId(from.getInstrument().getId()); dto.setInstrumentName(from.getInstrument().getName()); } if (from.getArray() != null) { dto.setArray(asDto(from.getArray())); } dto.setStatus(from.getHealth().getKey()); if (from.getStartDate() != null) { dto.setStartDate(formatDate(from.getStartDate())); } if (from.getCompletionDate() != null) { dto.setCompletionDate(formatDate(from.getCompletionDate())); } if (from.getLastModified() != null) { dto.setLastModified(formatDate(from.getLastModified())); } return dto; }