Search in sources :

Example 6 with TissueType

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

the class HibernateTissueTypeDaoIT method testGet.

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

Example 7 with TissueType

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

the class Dtos method to.

public static TissueType to(@Nonnull TissueTypeDto from) {
    TissueType to = new TissueTypeImpl();
    setLong(to::setId, from.getId(), false);
    setString(to::setAlias, from.getAlias());
    setString(to::setDescription, from.getDescription());
    return to;
}
Also used : TissueType(uk.ac.bbsrc.tgac.miso.core.data.TissueType) 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) TissueTypeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl)

Example 8 with TissueType

use of uk.ac.bbsrc.tgac.miso.core.data.TissueType 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 9 with TissueType

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

the class HibernateTissueTypeDaoIT method testCreate.

@Test
public void testCreate() throws IOException {
    String alias = "New Type";
    TissueType tt = new TissueTypeImpl();
    tt.setAlias(alias);
    tt.setDescription("descriptive stuff");
    User user = (User) getSessionFactory().getCurrentSession().get(UserImpl.class, 1L);
    tt.setChangeDetails(user);
    long savedId = sut.create(tt);
    clearSession();
    TissueType saved = (TissueType) getSessionFactory().getCurrentSession().get(TissueTypeImpl.class, savedId);
    assertEquals(alias, saved.getAlias());
}
Also used : TissueType(uk.ac.bbsrc.tgac.miso.core.data.TissueType) User(com.eaglegenomics.simlims.core.User) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) TissueTypeImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 10 with TissueType

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

the class HibernateTissueTypeDaoIT method testGetByAlias.

@Test
public void testGetByAlias() throws IOException {
    String alias = "Test Type";
    TissueType tt = sut.getByAlias(alias);
    assertNotNull(tt);
    assertEquals(alias, tt.getAlias());
}
Also used : TissueType(uk.ac.bbsrc.tgac.miso.core.data.TissueType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

TissueType (uk.ac.bbsrc.tgac.miso.core.data.TissueType)11 TissueTypeImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.TissueTypeImpl)9 Test (org.junit.Test)5 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)5 SampleTissue (uk.ac.bbsrc.tgac.miso.core.data.SampleTissue)3 TissueOrigin (uk.ac.bbsrc.tgac.miso.core.data.TissueOrigin)3 TissueOriginImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.TissueOriginImpl)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 SampleClass (uk.ac.bbsrc.tgac.miso.core.data.SampleClass)2 SampleClassImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl)2 SampleTissueImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.SampleTissueImpl)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