|
Hi,
We are using hibernate interceptor (hibernate 2.0 event model) to capture audit data. We often navigate through a parent entity say "Person" even for a use case to delete person akas (PersonAkas).
Person has a one to many relationship to PersonAkas, so to delete a person Aka, we have a business method inside Person:
public void removePersonAka(personAka) throws BusinessRuleException {
//Busines rules here
Iterator iter = this.getPersonakas().iterator();
while (iter.hasNext()) {
PersonAka aka = (PersomAka)iter.next();
if(personAka.getId().equals(aka.getId()) {
//Business rules here. Throw BusinessRuleException if business rule check //fails
iter.remove();
break;
}
Now, when we use this method to delete a PersonAka, even the parent entity is marked dirty and an OnFulshDirty() is called. This leads to a false update audit recrord for Person. Is there any way we can get around this?
Please note that we have not updated the "Person" itself.
|