use of uk.ac.bbsrc.tgac.miso.core.data.StainCategory in project miso-lims by miso-lims.
the class Dtos method to.
public static Stain to(@Nonnull StainDto from) {
Stain to = new Stain();
setLong(to::setId, from.getId(), false);
setString(to::setName, from.getName());
setObject(to::setCategory, StainCategory::new, from.getCategoryId());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.StainCategory in project miso-lims by miso-lims.
the class Dtos method to.
public static StainCategory to(@Nonnull StainCategoryDto from) {
StainCategory to = new StainCategory();
setLong(to::setId, from.getId(), false);
setString(to::setName, from.getName());
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.StainCategory in project miso-lims by miso-lims.
the class HibernateStainCategoryDaoIT method testUpdate.
@Test
public void testUpdate() throws IOException {
long id = 1L;
String name = "New Name";
StainCategory cat = (StainCategory) getSessionFactory().getCurrentSession().get(StainCategory.class, id);
assertNotEquals(name, cat.getName());
cat.setName(name);
sut.update(cat);
clearSession();
StainCategory saved = (StainCategory) getSessionFactory().getCurrentSession().get(StainCategory.class, id);
assertEquals(name, saved.getName());
}
use of uk.ac.bbsrc.tgac.miso.core.data.StainCategory in project miso-lims by miso-lims.
the class HibernateStainCategoryDaoIT method testCreate.
@Test
public void testCreate() throws IOException {
String name = "New Category";
StainCategory cat = new StainCategory();
cat.setName(name);
long savedId = sut.create(cat);
clearSession();
StainCategory saved = (StainCategory) getSessionFactory().getCurrentSession().get(StainCategory.class, savedId);
assertEquals(name, saved.getName());
}
use of uk.ac.bbsrc.tgac.miso.core.data.StainCategory in project miso-lims by miso-lims.
the class HibernateStainCategoryDaoIT method testGet.
@Test
public void testGet() throws IOException {
long id = 1L;
StainCategory cat = sut.get(id);
assertNotNull(cat);
assertEquals(id, cat.getId());
}
Aggregations