Reputation: 73
AuditQuery query = auditReader.createQuery()
.forRevisionsOfEntity(AB.class, false, true)
.add(AuditEntity.property("bId").eq(bId))
.addOrder(AuditEntity.revisionNumber().desc());
The above code retrieves all revisions except RevType DEL
revisions as bId
column is null
.
I have three Tables A
, B
, and AB
. AB
table is a relationship table. So AB
table has abID
as PK, and aId
, bID
, Revision Info. Whenever B
is deleted, it updates AB_AUDv table with revtype
DELand keeps
aid,
bidas
null`.
To display the deleted B
, can anyone suggest me with a modified auditreader query?
Upvotes: 3
Views: 5441
Reputation: 8636
You can either:
org.hibernate.envers.store_data_at_delete
)Upvotes: 6