HHH-12169 - Document support for dependency injection for Envers revision listeners.

This commit is contained in:
Chris Cranford 2017-12-14 13:40:41 -05:00
parent a5bce26262
commit 735da4347d
1 changed files with 10 additions and 1 deletions

View File

@ -520,7 +520,7 @@ As demonstrated by the example above, the username is properly set and propagate
[WARNING]
====
**This strategy is deprecated since version 5.2 as an alternative is going to be provided in Hibernate Envers 6.0.**
**This strategy is deprecated since version 5.2. The alternative is to use dependency injection offered as of version 5.3.**
An alternative method to using the `org.hibernate.envers.RevisionListener` is to instead call the
[line-through]#https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/envers/AuditReader.html#getCurrentRevision-java.lang.Class-boolean-[`getCurrentRevision( Class<T> revisionEntityClass, boolean persist )`]#
@ -533,6 +533,15 @@ The method accepts a `persist` parameter indicating whether the revision entity
`false`:: means that the revision number will be `null`, but the revision entity will be persisted only if some audited entities have changed.
====
[NOTE]
====
As of Hibernate Envers 5.3, dependency injection is now supported for a `RevisionListener`.
This feature is up to the various dependency frameworks, such as CDI and Spring, to supply the
necessary implementation during Hibernate ORM bootstrap to support injection. If no qualifying
implementation is supplied, the `RevisionListener` will be constructed without injection.
====
[[envers-tracking-modified-entities-revchanges]]
=== Tracking entity names modified during revisions