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:

1 2 3 4 5 6 7 8 @Embedded @AttributeOverrides({@AttributeOverride(name = "code", column = @Column(name = "THE_TEST"))}) private TestCode testCode = TestCode.TEST; @Embedded @AttributeOverrides({@AttributeOverride(name = "code", column = @Column(name = "THE_CODE")), @AttributeOverride(name = "codeArt", column = @Column(name = "THE_CODEART"))}) private Code genericCode;

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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 @Embeddable public class TestCode extends AbstractCode { public static final int _TEST = 1; public static final TestCode TEST = new TestCode(_TEST); public TestCode(int code) { super(code); } // Needed for @Embeddable protected TestCode() { super(UNDEFINED); } @Override @Transient public String getCodeart() { return "TestCode"; }

and it's superclass:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 @MappedSuperclass @Access(AccessType.FIELD) public abstract class AbstractCode { /** Initial Value */ protected static final int UNDEFINED = -1; private int code = UNDEFINED; protected AbstractCode() { this(UNDEFINED); } /** * Constructor with code */ public AbstractCode(int code) { this.code = code; } public abstract String getCodeart(); public int getCode() { return code; } }

this is the embedded that works fine:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 @Embeddable public class Code extends AbstractCode { private String codeArt; public Code(int code, String codeArt) { super(code); this.codeArt = codeArt; } // Needed for @Embeddable protected Code() { this (UNDEFINED, null); } @Override public String getCodeart() { return codeArt; } }

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

Environment

None

Status

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

4.3.0.Final

Priority

Major