|
The fix on issue #HHH-4751 have a bug when inside the @Embedded class has an attribute with @ManyToOne annotation (not audited and no reference for audit). For each @ManyToOne annotation inside @embedded class attribute one audited of the @ManyToOne (audited class) attribute is lost (testing we discovered that the missing attributes order is based on reverse alphabetical order(Z-a)).
The problem is on generated tables (the lost attribute is not created) and in the audit process the values in attributes go to another fields (mix the value between the fields).
@Audited
public class ClassA implements Serializable {
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
@ManyToOne
@JoinColumns({
@JoinColumn(name = "fielda", referencedColumnName = "fielda", nullable = true),
@JoinColumn(name = "fieldb", referencedColumnName = "fieldb", nullable = true),
@JoinColumn(name = "classc", referencedColumnName = "classc", nullable = true)})
private ClassB classB;
...
}
@Entity
public class ClassB implements Serializable {
@EmbeddedId
private ClassBId id;
...
}
@Embeddable
public class ClassBId implements Serializable {
@Column(name="fielda", insertable = false, updatable = false)
private Integer fieldA;
@Column(name="fieldb", insertable = false, updatable = false)
private Integer fieldB;
@ManyToOne
@JoinColumn(name="classc", insertable = false, updatable = false)
private ClassC classC;
}
@Entity
public class ClassC implements Serializable {
...
}
|