<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Ian,</div><div><br></div><div>&nbsp;This query should load the Datasets</div><div>&nbsp;</div>'select l from DatasetImageLink as l left outer join fetch l.parent as ds where l.child.id = '<div><br></div><div>Maybe even&nbsp;</div><div><br></div><div>'select l from DatasetImageLink as l left outer join fetch l.parent where l.child.id = '<br><div><br></div><div><br></div><div>NB: I noticed you didn't use your param object below.</div><div><br></div><div>Try&nbsp;</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; "><font class="Apple-style-span" face="'Times New Roman'" size="4">list = service.findAllByQuery(<span style="color: rgb(180, 53, 241); ">'select l from DatasetImageLink as l left outer join fetch l.parent where l.child.id =:ids '</span>, param);</font></div></div></div></blockquote></div><div><br></div><div><br></div><div>&nbsp; Will.&nbsp;</div><div><br></div><div><br></div><br><div><div>On 17 Aug 2012, at 12:09, Munro, Ian wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">

<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello&nbsp;
<div><br>
</div>
<div>I wonder if anyone can help me with this?</div>
<div>Given a valid imageId I'm trying to get the name of the &nbsp;parent dataset using Matlab.</div>
<div><br>
</div>
<div>this snippet</div>
<div><br>
</div>
<div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><span class="Apple-tab-span" style="white-space: pre; "></span>ids = java.util.ArrayList();</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><span class="Apple-tab-span" style="white-space:pre"></span>ids.add(imageId);
<span style="color: #259b33">%add the id of the image.</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; color: rgb(37, 155, 51); min-height: 12px; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;<br class="webkit-block-placeholder">
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; param = omero.sys.ParametersI;</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; param.addIds(ids);</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; service = session.getQueryService();</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; list = service.findAllByQuery([<span style="color: #b435f1">'select l from DatasetImageLink as l where l.child.id = '</span>, num2str(ID)], []);</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; dataset = list.get(0).getParent();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; min-height: 12px; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br class="webkit-block-placeholder">
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; datasetId = dataset.getId().getValue()</font></div>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">runs fine &amp; gives me a datasetId that looks good (ie matches what I see with insight)</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">However this line&nbsp;</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">dataset.getName()&nbsp;</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">Gives me the following errors</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'">
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
Error using omero.model.DatasetI/getName</div>
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
Java exception occurred:</div>
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
omero.UnloadedEntityException: Object unloaded:omero.model.DatasetI@d0c94c0</div>
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<span class="Apple-tab-span" style="white-space:pre"></span>at omero.model.DatasetI.errorIfUnloaded(DatasetI.java:22)</div>
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<span class="Apple-tab-span" style="white-space:pre"></span>at omero.model.DatasetI.getName(DatasetI.java:668)</div>
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<span class="Apple-tab-span" style="white-space:pre"></span>at omero.model.Dataset.getName(Dataset.java:218)</div>
<div style="font-size: large; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<br>
</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">Any help welcome at this point. I assume "Object Unloaded" is a clue here?</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">Thanks</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Courier; ">
<font class="Apple-style-span" face="'Times New Roman'" size="4">Ian</font></div>
</font></div>
<div><font class="Apple-style-span" face="'Times New Roman'" size="4"><br>
</font></div>
<div><br>
</div>
</div>

_______________________________________________<br>ome-devel mailing list<br><a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.openmicroscopy.org.uk</a><br>http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel<br></blockquote></div><br></div></body></html>