use of uk.ac.bbsrc.tgac.miso.core.data.impl.SubprojectImpl in project miso-lims by miso-lims.
the class Dtos method toDetailedSample.
private static DetailedSample toDetailedSample(@Nonnull DetailedSampleDto from) {
DetailedSample to = null;
if (from.getClass() == SampleIdentityDto.class) {
to = toIdentitySample((SampleIdentityDto) from);
} else if (from.getClass() == SampleTissueDto.class) {
to = toTissueSample((SampleTissueDto) from);
} else if (from instanceof SampleTissueProcessingDto) {
to = toTissueProcessingSample((SampleTissueProcessingDto) from);
} else if (from instanceof SampleAliquotDto) {
to = toAliquotSample((SampleAliquotDto) from);
} else if (from instanceof SampleStockDto) {
to = toStockSample((SampleStockDto) from);
} else {
to = new DetailedSampleImpl();
}
if (from.getSubprojectId() != null) {
Subproject subproject = new SubprojectImpl();
subproject.setId(from.getSubprojectId());
to.setSubproject(subproject);
}
if (from.getSampleClassId() != null) {
SampleClass sampleClass = new SampleClassImpl();
sampleClass.setId(from.getSampleClassId());
to.setSampleClass(sampleClass);
}
to.setGroupId(nullifyStringIfBlank(from.getGroupId()));
to.setGroupDescription(nullifyStringIfBlank(from.getGroupDescription()));
to.setSynthetic(from.getSynthetic());
to.setCreationDate(LimsUtils.isStringEmptyOrNull(from.getCreationDate()) ? null : parseDate(from.getCreationDate()));
if (from.getIdentityId() != null) {
to.setIdentityId(from.getIdentityId());
}
to.setNonStandardAlias(from.getNonStandardAlias());
to.setParent(getParent(from));
setBigDecimal(to::setVolumeUsed, from.getVolumeUsed());
setBigDecimal(to::setNgUsed, from.getNgUsed());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SubprojectImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static Subproject to(@Nonnull SubprojectDto from) {
Subproject to = new SubprojectImpl();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
setString(to::setDescription, from.getDescription());
setBoolean(to::setPriority, from.getPriority(), true);
setObject(to::setReferenceGenome, ReferenceGenomeImpl::new, from.getReferenceGenomeId());
setObject(to::setParentProject, ProjectImpl::new, from.getParentProjectId());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.SubprojectImpl in project miso-lims by miso-lims.
the class HibernateSubprojectDaoIT method getCreateItem.
@Override
public Subproject getCreateItem() {
Subproject subproject = new SubprojectImpl();
subproject.setAlias("Exciting");
subproject.setPriority(true);
Project project = (Project) currentSession().get(ProjectImpl.class, 2L);
subproject.setParentProject(project);
ReferenceGenome reference = (ReferenceGenome) currentSession().get(ReferenceGenomeImpl.class, 1L);
subproject.setReferenceGenome(reference);
User user = (User) currentSession().get(UserImpl.class, 1L);
subproject.setChangeDetails(user);
return subproject;
}
Aggregations