Introduce AnnotationValueGeneration implementation for Envers revision number

Description

Currently if a user wishes to get the current revision number and store it in an entity, it involves:

The AuditReader#getCurrentRevision method is currently deprecated as of 5.2 and is scheduled to be removed as a part of Hibernate Envers 6. The RevisionListener interface works for situations where users need to inject values into the revision entity before its persisted but doesn't work for situations where users may need to obtain the revision number for some business purpose.

I propose we continue with the removal of #getCurrentRevision but look at offering an implementation of the AnnotationValueGeneration contract for the revision number where an entity mapping can designate a field to be populated by the revision number using GeenrationTiming.ALWAYS.

An example of how the mapping might look:

Environment

None

Assignee

Chris Cranford

Reporter

Chris Cranford

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major
Configure