• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Audit context - how to know which entities affected by this change

 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I will ask for 2 use cases:
1. user has list of shipping address + list of hotel address and etc.
now one of the shipping address has been changed. if you implement audit by hibernate interceptor of db triggers you dont have the context of the change. you dont know to say that one of the user shipping address has been changed. you just know that address street change from X to Y. any ideas?

2. many entities (from type Y) have reference to entiy X. now instance X-1 which is referenced by Y-1,Y-2,Y-3 is changed. The audit need to be registerd as a change for Y-1,Y-2,Y-3. do you have cases like this in your application? how you create the context? (one way will be to have a query for X taht will find all Y that depend on it, but somtimes it more than one join).

Thank you
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at Hibernate Envers project which is meant for auditing/versioning of persistent classes?
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw this project , but as much as i understand it will not solve the context problem.
you will get audit that table Y was changed , but you will not know the context that Y is shipping address of user AAA.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic