[ome-devel] Hibernate PropertyAccessExcpetion when creating WellSamples in 4.0.1
Bernhard Holländer
bernhard.voigt at gmail.com
Mon Apr 27 16:22:24 BST 2009
Hi Josh!
> On import, each well sample is added to the well in the same order. So
> wellA.getSample(1) and wellB.getSample(1) will return related
> fields. Note: in the 4.1 database (currently trunk), there is a new
> field "Plate.defaultSample" which can be used to store the users
> choice of the current Well.wellSample index. This will be released
> before the meeting in Paris (May 19-20).
Great, thanks for the info.
> > I try if it's possible to load the existing well, add a well sample
> > and save the modified well to insert the new sample. If you see a
> > problem in this approach, please let me know.
>
> This should work. You'll have to be careful about keeping your objects
> loaded and up-to-date, but that's standard fare.
This approach seems to work, but I still have questions:
I select the well and its well samples like this:
select w from Well w
left outer join fetch w.wellSamples
Do I have to load other relations in order not to delete them when I
save the well later?
Here's the modified code to add well samples to existing wells:
ws = WellSampleI()
ws.well = WellI(w.id, False) # w comes from the query above
ws.image = ImageI(image.id, False)
w.addWellSample(ws)
w = self.updates.saveAndReturnObject(w)
ws = w.getWellSample(w.sizeOfWellSamples()-1)
ws = WellSampleI(ws.id.val, False)
# now link ws to a screen acquistion
>From your previous post I assume the last sample in the list of well
samples is the newest added?
As always, thanks for your help! Bernhard
More information about the ome-devel
mailing list