Search in sources :

Example 1 with ReferenceGenome

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);
}
Also used : ReferenceGenome(uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome)

Example 2 with ReferenceGenome

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;
}
Also used : ReferenceGenomeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl) ReferenceGenome(uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome)

Example 3 with 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;
}
Also used : ReferenceGenomeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl) ReferenceGenome(uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome) IonTorrentRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto) QcHierarchyNodeDto(uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto) RunPositionDto(uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto) PacBioRunDto(uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto) Ls454RunDto(uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto) IlluminaNotificationDto(ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto) OxfordNanoporeRunDto(uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto) IlluminaRunDto(uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto) NotificationDto(ca.on.oicr.gsi.runscanner.dto.NotificationDto) OxfordNanoporeNotificationDto(ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto) RunDto(uk.ac.bbsrc.tgac.miso.dto.run.RunDto) SolidRunDto(uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto) OrderAliquotDto(uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto) ScientificName(uk.ac.bbsrc.tgac.miso.core.data.ScientificName)

Example 4 with ReferenceGenome

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;
}
Also used : ReferenceGenome(uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome) Query(org.hibernate.Query)

Example 5 with ReferenceGenome

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());
}
Also used : ReferenceGenomeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl) ReferenceGenome(uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

ReferenceGenome (uk.ac.bbsrc.tgac.miso.core.data.ReferenceGenome)12 ReferenceGenomeImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.ReferenceGenomeImpl)7 Test (org.junit.Test)6 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)6 User (com.eaglegenomics.simlims.core.User)2 UserImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl)2 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)1 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)1 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)1 Date (java.util.Date)1 Query (org.hibernate.Query)1 Before (org.junit.Before)1 Project (uk.ac.bbsrc.tgac.miso.core.data.Project)1 ScientificName (uk.ac.bbsrc.tgac.miso.core.data.ScientificName)1 Subproject (uk.ac.bbsrc.tgac.miso.core.data.Subproject)1 ProjectImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.ProjectImpl)1 SubprojectImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SubprojectImpl)1 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)1 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)1 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)1