[ome-devel] dataset.getname() gives error? Matlab
Munro, Ian
i.munro at imperial.ac.uk
Fri Aug 17 14:16:18 BST 2012
Thanks Will.
That worked perfectly but I but I now have zero understanding of what I'm doing.
Which bit was the problem? the search string or failing to use the param object.
Ian
On 17 Aug 2012, at 13:52, Will Moore wrote:
Hi Ian,
This query should load the Datasets
'select l from DatasetImageLink as l left outer join fetch l.parent as ds where l.child.id = '
Maybe even
'select l from DatasetImageLink as l left outer join fetch l.parent where l.child.id = '
NB: I noticed you didn't use your param object below.
Try
list = service.findAllByQuery('select l from DatasetImageLink as l left outer join fetch l.parent where l.child.id =:ids ', param);
Will.
On 17 Aug 2012, at 12:09, Munro, Ian wrote:
Hello
I wonder if anyone can help me with this?
Given a valid imageId I'm trying to get the name of the parent dataset using Matlab.
this snippet
ids = java.util.ArrayList();
ids.add(imageId); %add the id of the image.
param = omero.sys.ParametersI;
param.addIds(ids);
service = session.getQueryService();
list = service.findAllByQuery(['select l from DatasetImageLink as l where l.child.id = ', num2str(ID)], []);
dataset = list.get(0).getParent();
datasetId = dataset.getId().getValue()
runs fine & gives me a datasetId that looks good (ie matches what I see with insight)
However this line
dataset.getName()
Gives me the following errors
Error using omero.model.DatasetI/getName
Java exception occurred:
omero.UnloadedEntityException: Object unloaded:omero.model.DatasetI at d0c94c0
at omero.model.DatasetI.errorIfUnloaded(DatasetI.java:22)
at omero.model.DatasetI.getName(DatasetI.java:668)
at omero.model.Dataset.getName(Dataset.java:218)
Any help welcome at this point. I assume "Object Unloaded" is a clue here?
Thanks
Ian
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20120817/1413b8b7/attachment-0001.html>
More information about the ome-devel
mailing list