[ome-devel] load object graph

jean-marie j.burel at dundee.ac.uk
Thu Nov 27 12:12:24 GMT 2008


Hi Bernhard

That's the call I do to retrieve the  wells within a plate.


Set loadPlateWells(long plateID, long userID)
  throws DSOutOfServiceException, DSAccessException
	{
		isSessionAlive();
		try {
			List results = null;
			IQueryPrx service = getQueryService();
			StringBuilder sb = new StringBuilder();
			ParametersI param = new ParametersI();
			param.addLong("plateID", plateID);
			
			sb.append("select well from Well as well ");
			sb.append("left outer join fetch well.wellSamples as ws ");
			sb.append("left outer join fetch ws.image as img ");
			
			sb.append("left outer join fetch img.pixels as pix ");
             sb.append("left outer join fetch pix.pixelsType as pt ");
			
             sb.append("where well.plate.id = :plateID");
             results = service.findAllByQuery(sb.toString(), param);
			Iterator i;
			Well well;
			Set<DataObject> wells = new HashSet<DataObject>();
			i = results.iterator();
			WellData wellData;
			List<WellSampleData> list;
			Map<Long, List<WellSampleData>>
				map = new HashMap<Long, List<WellSampleData>>();
			Iterator<WellSample> j;
			WellSample ws;
			
			while (i.hasNext()) {
				well = (Well) i.next();
				wellData = (WellData) PojoMapper.asDataObject(well);
				wells.add(wellData);
			}

			
			return wells;
		} catch (Exception e) {
			handleException(e, "Cannot load plate");
		}
		return new HashSet();


The OMERO.insight manipulates DataObject (pojos.DataObject)
So you can ignore that part.

Let me know if you have any questions.
The logic of this call is currently sitting in OMERO.insight, It will  
be moved
to one of the services provided later.

Ciao

jmarie





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20081127/da5c204f/attachment-0001.htm 


More information about the ome-devel mailing list