We're updating the issue view to help you get more done. 

incorrect primary key for audit table of element collection property of entity

Description

1 2 3 4 5 6 7 8 @Audited @Entity public class TestEntity { ... @ElementCollection private List<Child> children; ... }

The class Child is any Embeddable. So the table TestEntity_children has not a primary key. This may cause the problem.

generate this scheme:

1 2 3 4 5 6 7 create table [TestEntity_children_AUD] ( [REV] int not null, [TestEntity_id] bigint not null, [REVTYPE] smallint, ... primary key ([REV], [REVTYPE], [TestEntity_id]) )

This is wrong. this cause a children property must have only one element in it. Or not unique exception will be thrown!

Environment

mssql 2012, wildfly 10.1.0.Final

Status

Assignee

Chris Cranford

Reporter

Xj Chen

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.10

Components

Affects versions

5.1.10
5.1.11
5.2.12

Priority

Blocker