gloeglm wrote:
Well I don't really get why passing an object containing the values would be more "mapping dependant" than passing the arrays, however ...
Well I have some access="field" properties that I don't want to expose to anyone. i.e. The object exposes a slightly different API than that seen by Hibernate. I want the class that I'm calling to deal with something that looks like the object, not the properties mentioned in the mapping files.
gloeglm wrote:
For 1, you can use Reflection or if you want it more easily, something like Jakarta Beanutils. The second approach sounds really overcomplicated to me, in fact you do have every Information you need in the flushDirty method, don't you?
Reflection would only work for properties that are access="property", right?
As you say, the second option may be a a bit complicated. However, it should be a straighforward thing to ask an object if it has been modified, what has been modified, and how it was modified (old/new value). These are common questions to ask of an object, so I'm sure that the answers can be provided by Hibernate. I just don't know how. :)