ds = (Dataset) img.iterateOverDatasetLinks().next();
ds = (Dataset) img.linkedDatasetIterator().next();
    public void testAndSaveSomtheingWithParents() throws Exception    {        saveImage();        ds = (Dataset) img.iterateOverDatasetLinks().next();        Long id = ds.getId();                // another copy        Image img2 = (Image) iQuery.queryUnique(                "select i from Image i " +                "left outer join fetch i.datasetLinks " +                "where i.id = ?",                new Object[]{img.getId()});        assertTrue("It better have a dataset link too",                img2.sizeOfDatasetLinks()>0);        Dataset ds2 = (Dataset) img2.iterateOverDatasetLinks().next();        assertTrue("And the ids have to be the same",id.equals(ds2.getId()));    }