@Override public List<LibraryDilution> getDilutionsForKdTsRelationship(KitDescriptor kd, TargetedSequencing ts) { Criteria criteria = currentSession().createCriteria(LibraryDilution.class); criteria.createAlias("library.kitDescriptor", "kitDescriptor"); criteria.add(Restrictions.eq("kitDescriptor.id", kd.getId())); criteria.add(Restrictions.eq("targetedSequencing.id", ts.getId())); @SuppressWarnings("unchecked") List<LibraryDilution> records = criteria.list(); return records; }
private void loadChildEntities(KitDescriptor kitDescriptor) throws IOException { Set<TargetedSequencing> maybeManaged = Sets.newHashSet(kitDescriptor.getTargetedSequencing()); kitDescriptor.clearTargetedSequencing(); for (TargetedSequencing ts : maybeManaged) { if (ts != null && ts.getId() != TargetedSequencing.UNSAVED_ID) { kitDescriptor.addTargetedSequencing(targetedSequencingService.get(ts.getId())); } } }
public static TargetedSequencingDto asDto(@Nonnull TargetedSequencing from) { TargetedSequencingDto dto = new TargetedSequencingDto(); dto.setId(from.getId()); dto.setAlias(from.getAlias()); dto.setArchived(from.isArchived()); dto.setKitDescriptorIds(from.getKitDescriptors().stream().map(KitDescriptor::getId).collect(Collectors.toList())); return dto; }
private static DilutionDto asDto(@Nonnull LibraryDilution from, @Nonnull LibraryDto libraryDto, boolean includeBoxPositions) { DilutionDto dto = new DilutionDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setDilutionUserName(from.getCreator().getFullName()); dto.setConcentration(from.getConcentration() == null ? null : from.getConcentration().toString()); dto.setConcentrationUnits(from.getConcentrationUnits()); dto.setVolume(from.getVolume() == null ? null : from.getVolume().toString()); dto.setVolumeUnits(from.getVolumeUnits()); dto.setNgUsed(from.getNgUsed() == null ? null : from.getNgUsed().toString()); dto.setVolumeUsed(from.getVolumeUsed() == null ? null : from.getVolumeUsed().toString()); if (from.getCreationDate() != null) { dto.setCreationDate(formatDate(from.getCreationDate())); } dto.setIdentificationBarcode(from.getIdentificationBarcode()); dto.setLocationLabel(BoxUtils.makeLocationLabel(from)); if (from.getTargetedSequencing() != null) { dto.setTargetedSequencingId(from.getTargetedSequencing().getId()); } dto.setLibrary(libraryDto); if (from.getBox() != null) { dto.setBox(asDto(from.getBox(), includeBoxPositions)); dto.setBoxPosition(from.getBoxPosition()); } dto.setDiscarded(from.isDiscarded()); return dto; }
/** * Loads persisted objects into LibraryDilution fields. Should be called before saving LibraryDilutions. Loads all member objects * <b>except</b> * <ul> * <li>creator/lastModifier User objects</li> * </ul> * * @param libraryDilution the LibraryDilution to load entities into. Must contain at least the IDs of objects to load (e.g. to load the * persisted Library * into dilution.library, dilution.library.id must be set) * @throws IOException */ private void loadChildEntities(LibraryDilution dilution) throws IOException { if (dilution.getLibrary() != null) { dilution.setLibrary(libraryService.get(dilution.getLibrary().getId())); } if (dilution.getTargetedSequencing() != null) { dilution.setTargetedSequencing(targetedSequencingService.get(dilution.getTargetedSequencing().getId())); } if (dilution.getSecurityProfile() != null && dilution.getSecurityProfile().getProfileId() != SecurityProfile.UNSAVED_ID) { dilution.setSecurityProfile(securityProfileStore.get(dilution.getSecurityProfile().getProfileId())); } }
original.setReferenceGenome(referenceGenomeDao.getReferenceGenome(project.getReferenceGenome().getId())); if (project.getDefaultTargetedSequencing() != null) { original.setDefaultTargetedSequencing(targetedSequencingStore.get(project.getDefaultTargetedSequencing().getId())); } else { original.setDefaultTargetedSequencing(null);