use of uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome in project miso-lims by miso-lims.
the class DefaultReferenceGenomeService method update.
@Override
public long update(ReferenceGenome reference) throws IOException {
authorizationManager.throwIfNonAdmin();
ValidationUtils.loadChildEntity(reference::setDefaultScientificName, reference.getDefaultScientificName(), scientificNameService, "defaultScientificNameId");
ReferenceGenome managed = get(reference.getId());
validateChange(reference, managed);
applyChanges(managed, reference);
return referenceGenomeDao.update(managed);
}
use of uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome 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.ReferenceGenome 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.ReferenceGenome in project miso-lims by miso-lims.
the class HibernateReferenceGenomeDao method list.
@Override
public List<ReferenceGenome> list() {
Query query = currentSession().createQuery("from ReferenceGenomeImpl");
@SuppressWarnings("unchecked") List<ReferenceGenome> records = query.list();
return records;
}
use of uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome 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());
}
Aggregations