A revision number uniquely identifies a version of an entity, hence when getting an entity at a specific revision, you get it with the values it had back then.
To get the old and new values of fields, if you know the entity has been changed at revision N
, the easiest way is to get the entity at revisions N-1
and N
and compare the fields you are interested in.
This can be done in a single query using the forRevisonsOfEntity
query (see the AuditReader
and AuditQueryCreator
javadocs)