Reputation: 167
I am querying as following
AuditQuery si_query = audQueryCreator.forRevisionsOfEntity(SecurityIdentifiers.class, false, false)
.add(AuditEntity.revisionNumber().eq(revision_Id));
Above Query doesn't contain deleted data (data with revision type '2').
If I add following code
si_query.add(AuditEntity.revisionType().eq(RevisionType.DEL));
then it fetch only deleted data, that I don't want.
I want deleted data along with inserted data and modified data.
This query brings all other data except deleted one.
So Please tell me how to query to include deleted data too.
Upvotes: 0
Views: 747
Reputation: 21113
The problem is your usage, particularly the last argument but also perhaps the second too.
In order to have deleted rows returned in the results, you have to specify the last argument to that method as true
. The method java documentation for that argument says:
If true, also revisions where entities were deleted will be returned. The additional entities will have revision type "delete", and contain no data (all fields null), except for the id field.
My next concern is your expected result object type. This is related to the second argument to the method. The method java documentation for that argument says:
If true, instead of a list of three-element arrays, a list of entities will be returned as a result of executing this query.
So the question is whether you expect the returned list of values to be the actual audited entity instances or whether you expect it to be a List<Object[]>
where each object array row contains a specific set of values.
By specifying true
, the result is List<Object>
but false
it's List<Object[]>
.
If you use false
, each row will consist of:
HTH.
Upvotes: 1