Envers: Column of Embedded missing in Audit Table

Description

NOTE: THE "FIX" THAT WAS APPLIED FOR THIS ISSUE WAS INCORRECT, AND WAS COMPLETELY REVERTED BY IN THE SAME HIBERNATE ORM RELEASE. PLEASE SEE FOR MORE INFORMATION.

I have a simple Audited TestClass with two Embedded Attributes:

In the irst case, the column named "THE_TEST" is missing in the Audit Table. The Second attribute is ok.

The class TestCode where the Column is missing:

and it's superclass:

this is the embedded that works fine:

when I add @Audited to the class TestClass it works; but I think this should not be necessary.

Environment

None

Activity

Show:
Stephen Fikes
February 28, 2014, 12:54 AM

The issue seems, specifically, to be with the fact that TestCode extends AbstractCode without adding any attributes. This throws off the audit tracking. The workaround (as noted) is to (1) explicitly mark TestCode as @Audited or (2) add one or more attributes to the @Embeddable subclass (this latter is why Code works).

Brett Meyer
March 7, 2014, 5:37 PM

Hey , any thoughts on this one? Thanks!

Gail Badner
March 31, 2014, 8:34 PM

or , I added a pull request: https://github.com/hibernate/hibernate-orm/pull/726 .

Could one of you please take a look at the proposed fix?

Thanks,
Gail

Gail Badner
April 21, 2014, 11:16 PM

Fixed in master, 4.3, and 4.2.

Gail Badner
May 16, 2014, 12:23 AM
Edited

needs to be reverted because it makes an incorrect assumption. Mapped-superclass fields/methods should not be audited unless explictly audited or by using an @AuditOverride.

That is how it currently works for an entity that extends a mapped-superclass; it should work the same way when an embeddable extends a mapped-superclass.

For the test case described in this issue, testCode.code and genericCode.code should not be audited. Only genericCode.codeArt should be audited because the embeddable contains the codeArt field (not the mapped-superclass).

will revert HHH-8908. will make the audit behavior consistent.

Assignee

Gail Badner

Reporter

Jakob Braeuchi

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure