steve wrote:
Why exactly is it not intuitive that an insert would not have previous state?
i meant it's not intuitive that hibernate calls onFlushDirty on an entity that is currently being inserted. then what is onSave for?
what is intuitive for me is one callback method for update situations and another one for save situations. now we have one for save and one for save/update.
and still it would be ok, if it were documented in that way. but:
"Called when an object is detected to be dirty, during a flush."
this implies for me that the object is already known to hibernate, so onFlushDirty is only called for update()'s. again, it could be only my bugous thinking...
but if you accept a subjective opinion, i have a feeling that the wording of the documentation is written in the context of the hibernate implementation, not in the context of generic o/r mapping. which implies some knowledge about the hibernate code, without which many things are not clear or behave unexpected.
again it's just an opinion.
steve wrote:
And if you say "because its already been saved", please stop and go read the documentation.
i've met this attitude so many times in this project... you don't give a thing on user feedback. which is probably reasonable guessing the noise made by newbies, but still it shouldn't be the way...
the less you listen to the annoyance of users, the more noise will be generated when unexpected behaviour is seen.
don't misunderstand me, still a huge thanks for hibernate!!! i really appreciate the free work you do on this project!!!