use of uk.ac.bbsrc.tgac.miso.core.data.impl.Pipeline 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.Pipeline in project miso-lims by miso-lims.
the class HibernatePipelineDaoIT method getCreateItem.
@Override
public Pipeline getCreateItem() {
Pipeline pipeline = new Pipeline();
pipeline.setAlias("New Pipeline");
return pipeline;
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.Pipeline in project miso-lims by miso-lims.
the class HibernateProjectDaoIT method testSave.
/**
* Test method for {@link uk.ac.bbsrc.tgac.miso.persistence.impl.HibernateProjectDao#save(uk.ac.bbsrc.tgac.miso.core.data.Project)} .
*/
@Test
public void testSave() throws Exception {
Pipeline pipeline = (Pipeline) currentSession().get(Pipeline.class, 1L);
final String testAlias = "test alias";
project.setAlias(testAlias);
project.setPipeline(pipeline);
long savedProjectId = projectDAO.save(project);
Project savedProject = projectDAO.get(savedProjectId);
assertEquals(testAlias, savedProject.getAlias());
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.Pipeline in project miso-lims by miso-lims.
the class Dtos method to.
public static Pipeline to(@Nonnull PipelineDto from) {
Pipeline to = new Pipeline();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
return to;
}
Aggregations