IMO, the easiest way to implement a soft-delete would be to add a flag in your entities and to use:
- the
@SQLDelete
annotation to override the default Hibernatedelete
(and perform an update of the flag) - the
@Where
(or@Filters
?) annotation on your entities and associations to filter the deleted entities
Not sure how this can fit with your Auditing
table though. Some further exploration and testing are required.
Resources
Pascal Thivent
2010-10-21 15:50:18