NOTE: THE "FIX" THAT WAS APPLIED FOR THIS ISSUE WAS INCORRECT, AND WAS COMPLETELY REVERTED BY HHH-9194 IN THE SAME HIBERNATE ORM RELEASE. PLEASE SEE HHH-9193 FOR MORE INFORMATION.
I have a simple Audited TestClass with two Embedded Attributes:
{code} @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; {code}
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: {code} @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"; } {code}
and it's superclass:
{code} @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; } } {code}
this is the embedded that works fine:
{code} @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; } } {code}
when I add @Audited to the class TestClass it works; but I think this should not be necessary. |
|