Search in sources :

Example 1 with Lab

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

the class Dtos method to.

public static Lab to(@Nonnull LabDto from) {
    Lab to = new LabImpl();
    setLong(to::setId, from.getId(), false);
    setString(to::setAlias, from.getAlias());
    setBoolean(to::setArchived, from.getArchived(), false);
    return to;
}
Also used : 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) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab)

Example 2 with Lab

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

the class HibernateLabDao method list.

@Override
public List<Lab> list() {
    Query query = currentSession().createQuery("from LabImpl");
    @SuppressWarnings("unchecked") List<Lab> labs = query.list();
    return labs;
}
Also used : Query(org.hibernate.Query) Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab)

Example 3 with Lab

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

the class HibernateLabDaoIT method testUpdateLab.

@Test
public void testUpdateLab() {
    Lab l = dao.get(1L);
    final String newAlias = "Changed Alias";
    l.setAlias(newAlias);
    dao.update(l);
    Lab updated = dao.get(1L);
    assertEquals(newAlias, updated.getAlias());
}
Also used : Lab(uk.ac.bbsrc.tgac.miso.core.data.Lab) Test(org.junit.Test) AbstractDAOTest(uk.ac.bbsrc.tgac.miso.AbstractDAOTest)

Example 4 with Lab

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

the class HibernateLabDaoIT method testAddLab.

@Test
public void testAddLab() {
    Lab l = new LabImpl();
    l.setAlias("NewLab");
    User user = new UserImpl();
    user.setId(1L);
    l.setCreator(user);
    l.setLastModifier(user);
    Date now = new Date();
    l.setCreationTime(now);
    l.setLastModified(now);
    final long newId = dao.create(l);
    Lab saved = dao.get(newId);
    assertNotNull(saved);
    assertEquals(l.getAlias(), saved.getAlias());
}
Also used : User(com.eaglegenomics.simlims.core.User) 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 5 with Lab

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

the class HibernateLabDaoIT method testGetUsageByTransfers.

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

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