use of uk.ac.bbsrc.tgac.miso.core.data.SamplePurpose in project miso-lims by miso-lims.
the class HibernateSamplePurposeDaoIT method testGetUsage.
@Test
public void testGetUsage() throws Exception {
SamplePurpose purpose1 = (SamplePurpose) currentSession().get(SamplePurposeImpl.class, 1L);
assertEquals(1, getTestSubject().getUsage(purpose1));
SamplePurpose purpose2 = (SamplePurpose) currentSession().get(SamplePurposeImpl.class, 2L);
assertEquals(0, getTestSubject().getUsage(purpose2));
}
use of uk.ac.bbsrc.tgac.miso.core.data.SamplePurpose in project miso-lims by miso-lims.
the class Dtos method to.
public static SamplePurpose to(@Nonnull SamplePurposeDto from) {
SamplePurpose to = new SamplePurposeImpl();
setLong(to::setId, from.getId(), false);
setString(to::setAlias, from.getAlias());
setBoolean(to::setArchived, from.isArchived(), false);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.SamplePurpose in project miso-lims by miso-lims.
the class HibernateSamplePurposeDaoIT method getCreateItem.
@Override
public SamplePurpose getCreateItem() {
SamplePurpose purpose = new SamplePurposeImpl();
purpose.setAlias("New Purpose");
User user = (User) currentSession().get(UserImpl.class, 1L);
purpose.setChangeDetails(user);
return purpose;
}
Aggregations