[ome-devel] Hibernate PropertyAccessExcpetion when creating WellSamples in 4.0.1
josh.moore at gmx.de
josh.moore at gmx.de
Mon Apr 27 16:11:59 BST 2009
Bernhard Holländer writes:
> Hi Josh!
Hallo.
> > The change moving to 4.0.x is that the relation Well->WelSample is now
> > ordered, so that users can change the display of an entire Plate to
> > use the same field.
> Ah, that's interesting. Could you please elaborate a little bit more
> on how this is achieved. I would have been using the WellSample's
> timepoint as a field counter to select the same field for an entires
> Plate.
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).
> > Though this exception is an abomination, Hibernate is telling you that
> > it's not possible to save the WellSample without it's Well instance
> > loaded. This makes sense since the Well.wellSamples List needs to be
> > loaded so that the "WellSample.well_index" column can be properly
> > initialized.
>
> I assume the well_index field is set automatically and not accessible
> through the object?
Exactly. Part of Hibernate's magic.
> > To do so, re-order your saves to save the Wells rather than the
> > WellSamples.
>
> Your proposal is fine, however, in our application one creates plates
> and all the wells before assigning samples taken in the well. In
> particular if a plate is measured multiple times I wouldn't create
> different well sets and have to assign well samples to existing wells.
> 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.
> Thanks! Bernhard
No problem.
~Josh.
More information about the ome-devel
mailing list