use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.
the class DefaultPartitionQcTypeService method update.
@Override
public long update(PartitionQCType type) throws IOException {
authorizationManager.throwIfNonAdmin();
PartitionQCType managed = get(type.getId());
validateChange(type, managed);
applyChanges(managed, type);
return partitionQcTypeDao.update(managed);
}
use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.
the class Dtos method to.
public static PartitionQCType to(@Nonnull PartitionQCTypeDto from) {
PartitionQCType to = new PartitionQCType();
setLong(to::setId, from.getId(), false);
setString(to::setDescription, from.getDescription());
setBoolean(to::setNoteRequired, from.isNoteRequired(), false);
setBoolean(to::setOrderFulfilled, from.isOrderFulfilled(), false);
setBoolean(to::setAnalysisSkipped, from.isAnalysisSkipped(), false);
return to;
}
use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.
the class HibernatePartitionQcTypeDaoIT method testUpdate.
@Test
public void testUpdate() throws IOException {
long typeId = 1L;
String newDesc = "New Desc";
PartitionQCType st = (PartitionQCType) getSessionFactory().getCurrentSession().get(PartitionQCType.class, typeId);
assertNotEquals(newDesc, st.getDescription());
st.setDescription(newDesc);
assertEquals(typeId, sut.update(st));
clearSession();
PartitionQCType saved = (PartitionQCType) getSessionFactory().getCurrentSession().get(PartitionQCType.class, typeId);
assertEquals(newDesc, saved.getDescription());
}
use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.
the class HibernatePartitionQcTypeDaoIT method testGet.
@Test
public void testGet() throws IOException {
long typeId = 1L;
PartitionQCType type = sut.get(typeId);
assertNotNull(type);
assertEquals(typeId, type.getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.PartitionQCType in project miso-lims by miso-lims.
the class HibernatePartitionQcTypeDaoIT method testGetUsage.
@Test
public void testGetUsage() throws IOException {
PartitionQCType ok = (PartitionQCType) getSessionFactory().getCurrentSession().get(PartitionQCType.class, 1L);
assertEquals("OK", ok.getDescription());
assertEquals(1L, sut.getUsage(ok));
}
Aggregations