use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class WorksetRestController method removeLibraries.
@DeleteMapping("/{worksetId}/libraries")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void removeLibraries(@PathVariable(value = "worksetId", required = true) long worksetId, @RequestBody List<Long> libraryIds) throws IOException {
Workset workset = getWorkset(worksetId);
List<Library> items = loadItems("Library", libraryIds, libraryService);
worksetService.removeLibraries(workset, items);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class WorksetRestController method addLibraries.
@PostMapping(value = "/{worksetId}/libraries")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void addLibraries(@PathVariable(value = "worksetId", required = true) long worksetId, @RequestBody List<Long> libraryIds) throws IOException {
Workset workset = getWorkset(worksetId);
List<Library> items = loadItems("Library", libraryIds, libraryService);
worksetService.addLibraries(workset, items);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryAliquotDaoIT method testSaveNew.
@Test
public void testSaveNew() throws IOException {
final LibraryAliquot ld = new LibraryAliquot();
final Library lib = new LibraryImpl();
UserImpl user = new UserImpl();
user.setId(1L);
user.setFullName("moi");
lib.setId(1L);
ld.setCreator(user);
ld.setLastModifier(user);
ld.setLibrary(lib);
ld.setConcentration(new BigDecimal("12.5"));
ld.setCreationDate(new Date());
ld.setCreationTime(new Date());
ld.setName("nom de plume");
ld.setAlias("TEST");
Long newId = dao.save(ld);
final LibraryAliquot saved = dao.get(newId);
assertNotNull(saved);
assertEquals(new BigDecimal("12.5"), saved.getConcentration());
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testGetPreviousNull.
public void testGetPreviousNull() throws Exception {
Library library = (Library) currentSession().get(LibraryImpl.class, 1L);
EntityReference previous = dao.getAdjacentLibrary(library, true);
assertNull(previous);
}
use of uk.ac.bbsrc.tgac.miso.core.data.Library in project miso-lims by miso-lims.
the class HibernateLibraryDaoIT method testListAll.
@Test
public void testListAll() throws Exception {
List<Library> libraries = dao.listAll();
List<Long> libraryIds = Arrays.asList(1l, 2l, 3l, 4l, 5l, 6l, 7l, 8l, 9l, 10l, 11l, 12l, 13l, 14l, 15l);
assertEquals(15, libraries.size());
for (Library library : libraries) {
assertTrue("bad library found", libraryIds.contains(library.getId()));
}
}
Aggregations