use of uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl in project miso-lims by miso-lims.
the class DefaultSampleServiceTest method humanReferenceGenome.
private ReferenceGenome humanReferenceGenome() {
ReferenceGenome referenceGenome = new ReferenceGenomeImpl();
referenceGenome.setAlias("hg19");
referenceGenome.setId(1L);
return referenceGenome;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static ReferenceGenome to(@Nonnull ReferenceGenomeDto from) {
ReferenceGenome to = new ReferenceGenomeImpl();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
setObject(to::setDefaultScientificName, ScientificName::new, from.getDefaultScientificNameId());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl in project miso-lims by miso-lims.
the class Dtos method to.
public static Project to(@Nonnull ProjectDto dto) {
Project to = new ProjectImpl();
setLong(to::setId, dto.getId(), false);
setString(to::setName, dto.getName());
setDate(to::setCreationTime, dto.getCreationDate());
setString(to::setAlias, dto.getAlias());
setString(to::setShortName, dto.getShortName());
setString(to::setDescription, dto.getDescription());
setObject(to::setStatus, dto.getStatus(), (key) -> StatusType.get(key));
setObject(to::setReferenceGenome, ReferenceGenomeImpl::new, dto.getReferenceGenomeId());
setObject(to::setDefaultTargetedSequencing, TargetedSequencing::new, dto.getDefaultTargetedSequencingId());
setObject(to::setPipeline, Pipeline::new, dto.getPipelineId());
setBoolean(to::setSecondaryNaming, dto.isSecondaryNaming(), false);
setString(to::setRebNumber, dto.getRebNumber());
setDate(to::setRebExpiry, dto.getRebExpiry());
setInteger(to::setSamplesExpected, dto.getSamplesExpected(), true);
if (dto.getContactId() != null || !isStringEmptyOrNull(dto.getContactName()) || !isStringEmptyOrNull(dto.getContactEmail())) {
Contact contact = new Contact();
setLong(contact::setId, dto.getContactId(), false);
setString(contact::setName, dto.getContactName());
setString(contact::setEmail, dto.getContactEmail());
to.setContact(contact);
}
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl in project miso-lims by miso-lims.
the class HibernateReferenceGenomeDaoIT method testCreate.
@Test
public void testCreate() throws IOException {
String alias = "New Reference";
ReferenceGenome ref = new ReferenceGenomeImpl();
ref.setAlias(alias);
long savedId = dao.create(ref);
clearSession();
ReferenceGenome saved = (ReferenceGenome) getSessionFactory().getCurrentSession().get(ReferenceGenomeImpl.class, savedId);
assertEquals(alias, saved.getAlias());
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl 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;
}
Aggregations