Auditing exception when nested entities in collection type filed have audit fields [DATACMNS-1519] #1949
Labels
in: mapping
Mapping and conversion infrastructure
status: declined
A suggestion or change that we don't feel we should currently apply
type: bug
A general bug
spring-projects-issues commentedApr 22, 2019
revivn opened DATACMNS-1519 and commented
Hi. I'm trying to add auto auditing into spring project using spring-data-commons,spring-data-mongodb,both version 2.1.3.RELEASE
@EnableMongoAuditing
.@CreatedDate
,@LastModifiedDate
,@CreatedBy
, and@LastModifiedBy
annotations.here's the data structure
!https://raw.githubusercontent.com/gbfvip/docs/master/nested%20entities.png!
here's the exception stack trace:
I found that method
in
PersistentPropertyAccessor
may have defect in this nested collection field scenario:
while object "parent" get the collection type of List<EntityB>
1.leafProperty is EntityB's annotated property field
2.leafProperty.getOwner() get PersistenceEntity of EntityB
3.leafProperty.getOwner().getPropertyAccessor(parent) try to get audit fileld's accessor of the given bean(which is List<entityB>) from PersistenceEntity of EntityB
4.IllegalArgumentException occurred
I've checked github's master branch and seems latest code still have the same behavior
Reference URL: https://stackoverflow.com/questions/55791005/how-do-i-using-mongodb-auditing-with-nested-auditable-objects
Issue Links:
("duplicates")
The text was updated successfully, but these errors were encountered: