We have a modifiedDate property in all of our model objects, and I was attempting to use an interceptor to set that value on any save or update call. So, in the onFlushDirty() and onSave() methods, I set the modifiedDate property for the entity to "new Date()". This is working great, except that we've found that under some circumstances the onFlushDirty() method gets called during the loading process.
Is this because some of the model objects have initializers for elements like hash sets and so forth?
Is onFlushDirty() the right method to use to watch for update() calls, or would onSave() take care of these, also?
Thanks in advance,
Dave
|