Summary
In this chapter, we discussed Java's SPI and OSGi model. This was necessary in order to understand the event architecture. As we saw, event listeners can be registered as services to respond to certain actions that take place in the persistence context. This sophisticated architecture empowers Hibernate to be pluggable and enables runtime environments to act as service providers.
We also discussed interceptors, which offer capability similar to events, but they are easier to create and use. The simplicity of interceptors is due to their lacking the sophisticated architecture that is used by events. For this reason, they are less modular and pluggable.
Finally, we looked at envers, which enable entity versioning and audit mechanisms. We showed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access