<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Ian,<div><br></div><div>The search string needed to have "<span class="Apple-style-span" style="color: rgb(180, 53, 241); font-family: 'Times New Roman'; font-size: large; ">left outer join fetch l.parent"</span><div><div>in order to load the Dataset.</div><div>You could do the same with l.child if you wanted to load the Image too. </div><div><br></div><div>The use of param is just a nicer way to add ids to the query (instead of formatting ids into the query string) but shouldn't change the behaviour. </div><div><br></div><div> Will. </div><div><br></div><div><br></div><div>On 17 Aug 2012, at 14:16, 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; ">
<div><br>
</div>
<div>Thanks Will.</div>
<div><br>
</div>
<div>That worked perfectly but I but I now have zero understanding of what I'm doing. </div>
<div>Which bit was the problem? the search string or failing to use the param object.</div>
<div><br>
</div>
<div><br>
</div>
<div>Ian</div>
<div><br>
</div>
<br>
<div>
<div>On 17 Aug 2012, at 13:52, Will Moore wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Hi Ian,</div>
<div><br>
</div>
<div> This query should load the Datasets</div>
<div> </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 </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 </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> Will. </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">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Hello
<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 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"> <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"> 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"> 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"> 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"> 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"> 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"> <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"> 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 & 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 </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() </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>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</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>