use of uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType in project miso-lims by miso-lims.
the class Dtos method to.
public static SequencingControlType to(@Nonnull SequencingControlTypeDto from) {
SequencingControlType to = new SequencingControlType();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType in project miso-lims by miso-lims.
the class HibernateSequencingControlTypeDaoIT method testGetUsage.
@Test
public void testGetUsage() throws Exception {
SequencingControlType type = (SequencingControlType) currentSession().get(SequencingControlType.class, 1L);
assertEquals(1L, sut.getUsage(type));
}
use of uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType in project miso-lims by miso-lims.
the class Dtos method to.
public static Sample to(@Nonnull SampleDto from) {
Sample to = null;
if (from instanceof DetailedSampleDto) {
to = toDetailedSample((DetailedSampleDto) from);
} else {
to = new SampleImpl();
}
if (from.getId() != null)
to.setId(from.getId());
to.setAccession(nullifyStringIfBlank(from.getAccession()));
to.setName(from.getName());
to.setDescription(nullifyStringIfBlank(from.getDescription()));
to.setIdentificationBarcode(nullifyStringIfBlank(from.getIdentificationBarcode()));
to.setLocationBarcode(nullifyStringIfBlank(from.getLocationBarcode()));
to.setSampleType(from.getSampleType());
setObject(to::setDetailedQcStatus, DetailedQcStatusImpl::new, from.getDetailedQcStatusId());
setString(to::setDetailedQcStatusNote, from.getDetailedQcStatusNote());
setObject(to::setScientificName, ScientificName::new, from.getScientificNameId());
to.setTaxonIdentifier(from.getTaxonIdentifier());
to.setAlias(from.getAlias());
to.setDescription(from.getDescription());
setBigDecimal(to::setInitialVolume, from.getInitialVolume());
setBigDecimal(to::setVolume, from.getVolume());
to.setVolumeUnits(from.getVolumeUnits());
setBigDecimal(to::setConcentration, from.getConcentration());
to.setConcentrationUnits(from.getConcentrationUnits());
to.setDiscarded(from.isDiscarded());
if (from.getProjectId() != null) {
to.setProject(new ProjectImpl());
to.getProject().setId(from.getProjectId());
}
to.setBoxPosition((SampleBoxPosition) makeBoxablePosition(from, (SampleImpl) to));
setObject(to::setRequisition, Requisition::new, from.getRequisitionId());
if (to.getRequisition() != null) {
Requisition toRequisition = to.getRequisition();
setString(toRequisition::setAlias, from.getRequisitionAlias());
if (from.getRequisitionAssayId() != null) {
setObject(toRequisition::setAssay, Assay::new, from.getRequisitionAssayId());
}
}
setObject(to::setSequencingControlType, SequencingControlType::new, from.getSequencingControlTypeId());
setObject(to::setSop, Sop::new, from.getSopId());
to.setCreationReceiptInfo(toReceiptTransfer(from, to));
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType in project miso-lims by miso-lims.
the class HibernateSequencingControlTypeDaoIT method testCreate.
@Test
public void testCreate() throws Exception {
String alias = "New Control Type";
SequencingControlType type = new SequencingControlType();
type.setAlias(alias);
long savedId = sut.create(type);
clearSession();
SequencingControlType saved = (SequencingControlType) currentSession().get(SequencingControlType.class, savedId);
assertNotNull(saved);
assertEquals(alias, saved.getAlias());
}
use of uk.ac.bbsrc.tgac.miso.core.data.SequencingControlType in project miso-lims by miso-lims.
the class HibernateSequencingControlTypeDaoIT method testGetByAlias.
@Test
public void testGetByAlias() throws Exception {
String alias = "Positive";
SequencingControlType type = sut.getByAlias(alias);
assertNotNull(type);
assertEquals(alias, type.getAlias());
}
Aggregations