Audit data not loaded for @ElementCollection

Description

Hi,

it appears to me, that envers does not find all the audited data when using an ElementCollection with a map. In the scenario described below, the data appears to be audited correctly in the database, but when trying to retrieve a revision, the map is always empty.

Environment

None

Activity

Show:
Chris Cranford
July 26, 2017, 7:12 PM
Edited

The problem is with the construction of the where predicates. the ThreeQueryGenerator assumes that both the map-key and map-value are derived from the same entity rather than the values being sourced from two different types.

The line in question here is this one:

It should have read B_AUD rather than C_AUD, therefore that is what is causing the query to return an empty map.
This predicate is specifically injected based on the call in ThreeEntityQueryGenerator at line 170.

Jürgen Lind
July 27, 2017, 5:29 AM

Thanks for the quick review, so I will refrain from setting up a reproducer.

Chris Cranford
July 27, 2017, 1:12 PM
Edited

, yep there is no need. The nice thing is this highlighted a poor assumption made in a couple of related tests to this query generator and thus I'll be fixing those as well. Unfortunately in the meantime, there really isn't a way to work around without building from source if its critical.

Jürgen Lind
July 27, 2017, 1:51 PM
Edited

It's ok that I do not have a work around as I am working on PoC so I can tell our customer that the issue will be addressed in the near future. I've been browsing the hibernate pages to find a time schedule but did not find one. Do you have a rough idea, when the next release will be available?

Chris Cranford
August 7, 2017, 12:51 PM

If you look at the HHH project's version list, we typically try to keep the release date of those unreleased versions updated but I know the next 5.2.x release has been delayed.

Assignee

Chris Cranford

Reporter

Jürgen Lind

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure