Quote:
How long should the array be? What should be in each element?
The length of the array is determined by the number of properties that are dirty. Each element is an index to the Object[] that was passed to the findDirty() method.
Quote:
Or is it OK to always return a single-element array containing a 0?
INot always I think. If you have mapped your class with dynamic-update="true" I think Hibernate needs the indexes to be able to generate the proper SQL statement. There may be other reasons as well, so it is probably safer to try to return the correct index values.
Quote:
is it OK to call methods on the first parameter (entity) that might change the value of fields that will be persisted? Or is it only legal to change the values of the state or currentState parameters?
I really don't know, but my feeling is that as long the method call doesn't cause lazy initialization of proxies or collections it may not do any harm, but I wouldn't expect the changed properties to get persisted to the database.