views:

1020

answers:

2
A: 

Seems like the relationship between parentAuditRecord and transferauditrecord and balance auditrecord shouldn't be one to many. When I read what you typed I'm seeing it as a table per subclass usage of that audit hierarchy which is a one-to-one relationship.

http://www.hibernate.org/hib_docs/reference/en/html/inheritance.html

You may also want to check out JBoss's Envers project.

zmf
A: 

At the design level, it seems like a insert only db design would work marvels here.

If you want to keep it the way it is right now (which I'm sure you do), you could look into Hibernate listeners/interceptors/events (well defined in the doc: http://www.hibernate.org/hib_docs/v3/reference/en-US/html_single/)

Else, I just looked into JBoss Envers and it also seems pretty useful.

Loki