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

strange behavior of collection property mod columns

Description

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 @Audited @Entity public class Entity { @Id private long id; private String value; @OrderColumn @ElementCollection private List<Embeddable> embeddables; ... // omit getter and setter ... } Entity entity = new Entity(); entity.setId(1); entity.setValue("a"); em.persist(entity);

This will create this audit record:

id

REV

REVTYPE

REVEND

REVEND_TSTMP

value

value_MOD

embeddables_MOD

1

1

0

NULL

NULL

a

1

1

However, if we update the entity after persist it. for example:

1 2 3 4 5 Entity entity = new Entity(); entity.setId(1); entity.setValue("a"); em.persist(entity); entity.setValue("b");

this will create this audit record:

id

REV

REVTYPE

REVEND

REVEND_TSTMP

value

value_MOD

embeddables_MOD

1

1

0

NULL

NULL

b

1

0

The value of column 'embeddables_MOD' changed from 1 to 0, though embeddables is not updated at all.

Environment

java 8, wildfly 10.1.0.Final

Status

Assignee

Chris Cranford

Reporter

Xj Chen

Fix versions

None

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.12

Components

Affects versions

5.1.15
5.1.12

Priority

Major