Search in sources :

Example 6 with Lab

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

the class HibernateLabDaoIT method testGetUsageByTissues.

@Test
public void testGetUsageByTissues() {
    Lab lab = dao.get(2L);
    assertEquals(1L, dao.getUsageByTissues(lab));
}
Also used : Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 7 with Lab

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

the class HibernateTransferDaoIT method testUpdate.

@Test
public void testUpdate() throws Exception {
    Transfer transfer = (Transfer) currentSession().get(Transfer.class, 1L);
    Lab lab = (Lab) currentSession().get(LabImpl.class, 4L);
    assertNotEquals(lab.getId(), transfer.getSenderLab().getId());
    transfer.setSenderLab(lab);
    sut.update(transfer);
    clearSession();
    Transfer saved = (Transfer) currentSession().get(Transfer.class, 1L);
    assertEquals(lab.getId(), saved.getSenderLab().getId());
}
Also used : Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 8 with Lab

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

the class HibernateTransferDaoIT method testCreate.

@Test
public void testCreate() throws Exception {
    Transfer transfer = new Transfer();
    Lab senderLab = (Lab) currentSession().get(LabImpl.class, 1L);
    transfer.setSenderLab(senderLab);
    Group recipientGroup = (Group) currentSession().get(Group.class, 1L);
    transfer.setRecipientGroup(recipientGroup);
    User user = (User) currentSession().get(UserImpl.class, 1L);
    transfer.setChangeDetails(user);
    transfer.setTransferTime(new Date());
    long savedId = sut.create(transfer);
    clearSession();
    Transfer saved = (Transfer) currentSession().get(Transfer.class, savedId);
    assertNotNull(saved);
    assertNotNull(saved.getSenderLab());
    assertEquals(senderLab.getAlias(), saved.getSenderLab().getAlias());
    assertNotNull(saved.getRecipientGroup());
    assertEquals(recipientGroup.getName(), saved.getRecipientGroup().getName());
}
Also used : Group(com.eaglegenomics.simlims.core.Group) User(com.eaglegenomics.simlims.core.User) Transfer(uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab) Date(java.util.Date) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 9 with Lab

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

the class Dtos method toTissueSample.

private static SampleTissue toTissueSample(@Nonnull SampleTissueDto from) {
    SampleTissue to = new SampleTissueImpl();
    to.setPassageNumber(from.getPassageNumber());
    to.setTimesReceived(from.getTimesReceived());
    to.setTubeNumber(from.getTubeNumber());
    to.setRegion(nullifyStringIfBlank(from.getRegion()));
    to.setSecondaryIdentifier(from.getSecondaryIdentifier());
    if (from.getTissueOriginId() != null) {
        TissueOrigin tissueOrigin = new TissueOriginImpl();
        tissueOrigin.setId(from.getTissueOriginId());
        to.setTissueOrigin(tissueOrigin);
    }
    if (from.getTissueTypeId() != null) {
        TissueType tissueType = new TissueTypeImpl();
        tissueType.setId(from.getTissueTypeId());
        to.setTissueType(tissueType);
    }
    if (from.getTissueMaterialId() != null) {
        TissueMaterial tissueMaterial = new TissueMaterialImpl();
        tissueMaterial.setId(from.getTissueMaterialId());
        to.setTissueMaterial(tissueMaterial);
    }
    if (from.getLabId() != null) {
        Lab lab = new LabImpl();
        lab.setId(from.getLabId());
        to.setLab(lab);
    }
    setString(to::setTimepoint, from.getTimepoint());
    return to;
}
Also used : SampleTissue(uk.ac.bbsrc.tgac.miso.core.data.SampleTissue) TissueMaterialImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueMaterialImpl) TissueOrigin(uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin) TissueType(uk.ac.bbsrc.tgac.miso.core.data.TissueType) TissueMaterial(uk.ac.bbsrc.tgac.miso.core.data.TissueMaterial) TissueOriginImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueOriginImpl) LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) 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) SampleTissueImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl) TissueTypeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab)

Example 10 with Lab

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

the class DefaultTransferServiceTest method makeLab.

private Lab makeLab(long labId) {
    Lab lab = new LabImpl();
    lab.setId(labId);
    return lab;
}
Also used : LabImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab)

Aggregations

Lab (uk.ac.bbsrc.tgac.miso.core.data.Lab)14 Test (org.junit.Test)10 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)10 LabImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LabImpl)7 Date (java.util.Date)3 Transfer (uk.ac.bbsrc.tgac.miso.core.data.impl.transfer.Transfer)3 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)2 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)2 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)2 Group (com.eaglegenomics.simlims.core.Group)2 User (com.eaglegenomics.simlims.core.User)2 UserImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl)2 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)2 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)2 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)2 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)2 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)2 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)2 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)2 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)2