I'm running Hibernate 3.
I have two types of domain objects. One has a base set of audit attributes (e.g., addedBy, editedBy) and another set has additional audit attributes (e.g., approvedBy). I was considering using two interceptors for this: one for the objects with just the standard audit attributes and one for the objects with the extended set. The question is...
If each interceptor is only knows about it's own audit attrbutes, what will happen if it reports that audit data from the other set has changed (afterall he doesn't know it's audit data)? I presume hibernate simply combines the result arrays from each findDirty() it calls and assumes dirtiness if at least one interceptor reported an attribute dirty. Do I need to have my interceptors aware of each other's audit data? Or would I be better off just merging all this into one interceptor? I prefer the two interceptor approach simply because it would be a lot cleaner code but I also want to know it will work and what the semantics are when there are multiple interceptors. Thanks,
marc
|