use of uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static TissueMaterial to(@Nonnull TissueMaterialDto from) {
TissueMaterial to = new TissueMaterialImpl();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl in project miso-lims by miso-lims.
the class Dtos method toTissueSample.
private static SampleTissue toTissueSample(@Nonnull SampleTissueDto from) {
SampleTissue to = new SampleTissueImpl();
to.setPassageNumber(from.getPassageNumber());
to.setTimesReceived(from.getTimesReceived());
to.setTubeNumber(from.getTubeNumber());
to.setRegion(nullifyStringIfBlank(from.getRegion()));
to.setSecondaryIdentifier(from.getSecondaryIdentifier());
if (from.getTissueOriginId() != null) {
TissueOrigin tissueOrigin = new TissueOriginImpl();
tissueOrigin.setId(from.getTissueOriginId());
to.setTissueOrigin(tissueOrigin);
}
if (from.getTissueTypeId() != null) {
TissueType tissueType = new TissueTypeImpl();
tissueType.setId(from.getTissueTypeId());
to.setTissueType(tissueType);
}
if (from.getTissueMaterialId() != null) {
TissueMaterial tissueMaterial = new TissueMaterialImpl();
tissueMaterial.setId(from.getTissueMaterialId());
to.setTissueMaterial(tissueMaterial);
}
if (from.getLabId() != null) {
Lab lab = new LabImpl();
lab.setId(from.getLabId());
to.setLab(lab);
}
setString(to::setTimepoint, from.getTimepoint());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl in project miso-lims by miso-lims.
the class MetricDto method to.
public Metric to() {
Metric to = new Metric();
setLong(to::setId, getId(), false);
setString(to::setAlias, getAlias());
setObject(to::setCategory, getCategory(), MetricCategory::valueOf);
setObject(to::setSubcategory, MetricSubcategory::new, getSubcategoryId());
setObject(to::setThresholdType, getThresholdType(), ThresholdType::valueOf);
setString(to::setUnits, getUnits());
setInteger(to::setSortPriority, getSortPriority(), true);
setObject(to::setNucleicAcidType, getNucleicAcidType(), NucleicAcidType::valueOf);
setObject(to::setTissueMaterial, TissueMaterialImpl::new, getTissueMaterialId());
setObject(to::setTissueType, TissueTypeImpl::new, getTissueTypeId());
setBoolean(to::setNegateTissueType, isNegateTissueType(), false);
setObject(to::setTissueOrigin, TissueOriginImpl::new, getTissueOriginId());
setObject(to::setContainerModel, SequencingContainerModel::new, getContainerModelId());
setInteger(to::setReadLength, getReadLength(), true);
setInteger(to::setReadLength2, getReadLength2(), true);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl in project miso-lims by miso-lims.
the class HibernateTissueMaterialDaoIT method getCreateItem.
@Override
public TissueMaterial getCreateItem() {
TissueMaterial material = new TissueMaterialImpl();
material.setAlias("New Mat");
User user = (User) currentSession().get(UserImpl.class, 1L);
material.setChangeDetails(user);
return material;
}
Aggregations