use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class DefaultInstrumentService method update.
@Override
public long update(Instrument instrument) throws IOException {
authorizationManager.throwIfNonAdmin();
Instrument managed = get(instrument.getId());
loadChildEntities(instrument);
validateChange(instrument, managed);
applyChanges(managed, instrument);
return save(managed);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateInstrumentDao method getByUpgradedInstrument.
@Override
public Instrument getByUpgradedInstrument(long id) {
Criteria criteria = currentSession().createCriteria(InstrumentImpl.class);
criteria.add(Restrictions.eq("upgradedInstrument.id", id));
return (Instrument) criteria.uniqueResult();
}
use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateInstrumentDaoIT method testGetByUpgradedInstrument.
@Test
public void testGetByUpgradedInstrument() throws Exception {
Instrument upgraded = dao.getByUpgradedInstrument(2L);
assertNotNull(upgraded);
assertEquals(6L, upgraded.getId());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateInstrumentDaoIT method testGetByName.
@Test
public void testGetByName() throws Exception {
String name = "old hiseq";
Instrument instrument = dao.getByName(name);
assertNotNull(instrument);
assertEquals(name, instrument.getName());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Instrument in project miso-lims by miso-lims.
the class HibernateInstrumentDaoIT method testGetUsageByArrayRuns.
@Test
public void testGetUsageByArrayRuns() throws Exception {
Instrument instrument = (Instrument) currentSession().get(InstrumentImpl.class, 3L);
assertEquals(1L, dao.getUsageByArrayRuns(instrument));
}
Aggregations