support auditing revised properties on detatched objects

Description

That will return all revisions, including the last 5 that solely updated the #name property. Calling Session#refresh prior to the Session#update is a workaround, as well as not clearing the Session after the add and each update. The issue appears to be limited to detached entities.

After discussing with & , Lukasz suggested:

I had a closer look at the issue. The root cause is that Brett updates detached entities. In SinglePropertyMapper#mapModifiedFlagsToMapFromEntity(SessionImplementor, Map, Object, Object) we do not know the previous state of the entity. We would need to introduce pre-update listener and query database (if needed) to cache original state of the entity. Of course, the issue applies only to "modified flag" feature.

Environment

None

Status

Assignee

Chris Cranford

Reporter

Brett Meyer

Fix versions

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure