Search in sources :

Example 1 with PartitionQCType

use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.

the class DefaultPartitionQcTypeService method update.

@Override
public long update(PartitionQCType type) throws IOException {
    authorizationManager.throwIfNonAdmin();
    PartitionQCType managed = get(type.getId());
    validateChange(type, managed);
    applyChanges(managed, type);
    return partitionQcTypeDao.update(managed);
}
Also used : PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType)

Example 2 with PartitionQCType

use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.

the class Dtos method to.

public static PartitionQCType to(@Nonnull PartitionQCTypeDto from) {
    PartitionQCType to = new PartitionQCType();
    setLong(to::setId, from.getId(), false);
    setString(to::setDescription, from.getDescription());
    setBoolean(to::setNoteRequired, from.isNoteRequired(), false);
    setBoolean(to::setOrderFulfilled, from.isOrderFulfilled(), false);
    setBoolean(to::setAnalysisSkipped, from.isAnalysisSkipped(), false);
    return to;
}
Also used : 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) PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType)

Example 3 with PartitionQCType

use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.

the class HibernatePartitionQcTypeDaoIT method testUpdate.

@Test
public void testUpdate() throws IOException {
    long typeId = 1L;
    String newDesc = "New Desc";
    PartitionQCType st = (PartitionQCType) getSessionFactory().getCurrentSession().get(PartitionQCType.class, typeId);
    assertNotEquals(newDesc, st.getDescription());
    st.setDescription(newDesc);
    assertEquals(typeId, sut.update(st));
    clearSession();
    PartitionQCType saved = (PartitionQCType) getSessionFactory().getCurrentSession().get(PartitionQCType.class, typeId);
    assertEquals(newDesc, saved.getDescription());
}
Also used : PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 4 with PartitionQCType

use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.

the class HibernatePartitionQcTypeDaoIT method testGet.

@Test
public void testGet() throws IOException {
    long typeId = 1L;
    PartitionQCType type = sut.get(typeId);
    assertNotNull(type);
    assertEquals(typeId, type.getId());
}
Also used : PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 5 with PartitionQCType

use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.

the class HibernatePartitionQcTypeDaoIT method testGetUsage.

@Test
public void testGetUsage() throws IOException {
    PartitionQCType ok = (PartitionQCType) getSessionFactory().getCurrentSession().get(PartitionQCType.class, 1L);
    assertEquals("OK", ok.getDescription());
    assertEquals(1L, sut.getUsage(ok));
}
Also used : PartitionQCType(uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

PartitionQCType (uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType)10 Test (org.junit.Test)6 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)6 RunPartition (uk.ac.bbsrc.tgac.miso.core.data.RunPartition)3 User (com.eaglegenomics.simlims.core.User)2 IOException (java.io.IOException)2 Collection (java.util.Collection)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 Library (uk.ac.bbsrc.tgac.miso.core.data.Library)2 Partition (uk.ac.bbsrc.tgac.miso.core.data.Partition)2 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)2 Run (uk.ac.bbsrc.tgac.miso.core.data.Run)2 RunPartitionAliquot (uk.ac.bbsrc.tgac.miso.core.data.RunPartitionAliquot)2 Sample (uk.ac.bbsrc.tgac.miso.core.data.Sample)2 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)2 RunPosition (uk.ac.bbsrc.tgac.miso.core.data.impl.RunPosition)2 RunPurpose (uk.ac.bbsrc.tgac.miso.core.data.impl.RunPurpose)2 ListLibraryAliquotView (uk.ac.bbsrc.tgac.miso.core.data.impl.view.ListLibraryAliquotView)2 PoolElement (uk.ac.bbsrc.tgac.miso.core.data.impl.view.PoolElement)2 AuthorizationManager (uk.ac.bbsrc.tgac.miso.core.security.AuthorizationManager)2