Search in sources :

Example 1 with LibraryStrategyType

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

the class Dtos method to.

public static LibraryStrategyType to(@Nonnull LibraryStrategyTypeDto from) {
    LibraryStrategyType to = new LibraryStrategyType();
    setLong(to::setId, from.getId(), false);
    setString(to::setName, from.getName());
    setString(to::setDescription, from.getDescription());
    return to;
}
Also used : LibraryStrategyType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType) 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)

Example 2 with LibraryStrategyType

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

the class Dtos method to.

public static LibraryDesign to(@Nonnull LibraryDesignDto from) {
    LibraryDesign to = new LibraryDesign();
    setLong(to::setId, from.getId(), false);
    setString(to::setName, from.getName());
    setObject(to::setSampleClass, SampleClassImpl::new, from.getSampleClassId());
    setObject(to::setLibraryDesignCode, LibraryDesignCode::new, from.getDesignCodeId());
    setObject(to::setLibrarySelectionType, LibrarySelectionType::new, from.getSelectionId());
    setObject(to::setLibraryStrategyType, LibraryStrategyType::new, from.getStrategyId());
    return to;
}
Also used : LibraryDesignCode(uk.ac.bbsrc.tgac.miso.core.data.LibraryDesignCode) LibraryDesign(uk.ac.bbsrc.tgac.miso.core.data.LibraryDesign) LibraryStrategyType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType) SampleClassImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleClassImpl) LibrarySelectionType(uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType) 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)

Example 3 with LibraryStrategyType

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

the class HibernateLibraryDaoIT method testCreate.

@Test
public void testCreate() throws Exception {
    Library library = new LibraryImpl();
    String libraryName = "newLibrary";
    library.setName(libraryName);
    library.setAlias("theAlias");
    library.setDescription("a description");
    library.setPlatformType(PlatformType.ILLUMINA);
    Sample sample = new SampleImpl();
    sample.setId(4);
    library.setSample(sample);
    LibraryType libraryType = new LibraryType();
    libraryType.setId(1L);
    library.setLibraryType(libraryType);
    LibrarySelectionType librarySelectionType = new LibrarySelectionType();
    librarySelectionType.setId(1L);
    library.setLibrarySelectionType(librarySelectionType);
    LibraryStrategyType libraryStrategyType = new LibraryStrategyType();
    libraryStrategyType.setId(1L);
    library.setLibraryStrategyType(libraryStrategyType);
    User mockUser = new UserImpl();
    mockUser.setId(1L);
    Date now = new Date();
    library.setCreator(mockUser);
    library.setCreationTime(now);
    library.setLastModifier(mockUser);
    library.setLastModified(now);
    long libraryId = dao.save(library);
    Library insertedLibrary = dao.get(libraryId);
    assertEquals(libraryName, insertedLibrary.getName());
    assertEquals("theAlias", insertedLibrary.getAlias());
    assertEquals("a description", insertedLibrary.getDescription());
    assertEquals(4, library.getSample().getId());
    assertEquals(1L, library.getLibraryType().getId());
    assertEquals(1L, library.getLibrarySelectionType().getId());
    assertEquals(1L, library.getLibraryStrategyType().getId());
}
Also used : LibraryStrategyType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType) User(com.eaglegenomics.simlims.core.User) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) DetailedSample(uk.ac.bbsrc.tgac.miso.core.data.DetailedSample) Sample(uk.ac.bbsrc.tgac.miso.core.data.Sample) LibrarySelectionType(uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType) LibraryType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType) UserImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.UserImpl) Library(uk.ac.bbsrc.tgac.miso.core.data.Library) SampleImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.SampleImpl) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Example 4 with LibraryStrategyType

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

the class HibernateLibraryStrategyDaoIT method testGetUsage.

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

Example 5 with LibraryStrategyType

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

the class HibernateLibraryStrategyDaoIT method testUpdate.

@Test
public void testUpdate() throws IOException {
    long id = 1L;
    String name = "New Name";
    LibraryStrategyType type = (LibraryStrategyType) getSessionFactory().getCurrentSession().get(LibraryStrategyType.class, id);
    assertNotEquals(name, type.getName());
    type.setName(name);
    sut.update(type);
    clearSession();
    LibraryStrategyType saved = (LibraryStrategyType) getSessionFactory().getCurrentSession().get(LibraryStrategyType.class, id);
    assertEquals(name, saved.getName());
}
Also used : LibraryStrategyType(uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

LibraryStrategyType (uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType)11 Test (org.junit.Test)6 AbstractDAOTest (uk.ac.bbsrc.tgac.miso.AbstractDAOTest)6 IlluminaNotificationDto (ca.on.oicr.gsi.runscanner.dto.IlluminaNotificationDto)4 NotificationDto (ca.on.oicr.gsi.runscanner.dto.NotificationDto)4 OxfordNanoporeNotificationDto (ca.on.oicr.gsi.runscanner.dto.OxfordNanoporeNotificationDto)4 LibrarySelectionType (uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType)4 OrderAliquotDto (uk.ac.bbsrc.tgac.miso.dto.PoolOrderDto.OrderAliquotDto)4 QcHierarchyNodeDto (uk.ac.bbsrc.tgac.miso.dto.dashi.QcHierarchyNodeDto)4 IlluminaRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IlluminaRunDto)4 IonTorrentRunDto (uk.ac.bbsrc.tgac.miso.dto.run.IonTorrentRunDto)4 Ls454RunDto (uk.ac.bbsrc.tgac.miso.dto.run.Ls454RunDto)4 OxfordNanoporeRunDto (uk.ac.bbsrc.tgac.miso.dto.run.OxfordNanoporeRunDto)4 PacBioRunDto (uk.ac.bbsrc.tgac.miso.dto.run.PacBioRunDto)4 RunDto (uk.ac.bbsrc.tgac.miso.dto.run.RunDto)4 RunPositionDto (uk.ac.bbsrc.tgac.miso.dto.run.RunPositionDto)4 SolidRunDto (uk.ac.bbsrc.tgac.miso.dto.run.SolidRunDto)4 LibraryType (uk.ac.bbsrc.tgac.miso.core.data.type.LibraryType)3 Index (uk.ac.bbsrc.tgac.miso.core.data.Index)2 Library (uk.ac.bbsrc.tgac.miso.core.data.Library)2