Search in sources :

Example 1 with LibrarySelectionType

use of uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType 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 2 with LibrarySelectionType

use of uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType 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 3 with LibrarySelectionType

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

the class HibernateLibrarySelectionDaoIT method testUpdate.

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

Example 4 with LibrarySelectionType

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

the class HibernateLibrarySelectionDaoIT method testGet.

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

Example 5 with LibrarySelectionType

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

the class HibernateLibrarySelectionDaoIT method testCreate.

@Test
public void testCreate() throws IOException {
    String name = "New Selection";
    LibrarySelectionType type = new LibrarySelectionType();
    type.setName(name);
    type.setDescription("desc");
    long savedId = sut.create(type);
    clearSession();
    LibrarySelectionType saved = (LibrarySelectionType) getSessionFactory().getCurrentSession().get(LibrarySelectionType.class, savedId);
    assertEquals(name, saved.getName());
}
Also used : LibrarySelectionType(uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest) Test(org.junit.Test)

Aggregations

LibrarySelectionType (uk.ac.bbsrc.tgac.miso.core.data.type.LibrarySelectionType)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 LibraryStrategyType (uk.ac.bbsrc.tgac.miso.core.data.type.LibraryStrategyType)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