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;
}
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;
}
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());
}
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());
}
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));
}
Aggregations