Skip to Content
Mastering Hibernate
book

Mastering Hibernate

by Ramin Rad
May 2016
Beginner
204 pages
4h 22m
English
Packt Publishing
Content preview from Mastering Hibernate

Events

As discussed in Chapter 1, Entity and Session, almost every action in the persistence context is translated into an event. This includes events such as load, save, merge, lock, and flush. For a complete list of events in Hibernate, you should look at the JavaDoc for org.hibernate.event.spi.EventType.

Every event in Hibernate has a corresponding listener that acts when the event is fired. The Hibernate event architecture uses the Service Provider Interface model to discover event listeners. This allows you to plug in your own listener for a certain event. In this section, we will show you how to write event listeners.

Event listener

Hibernate defines the event contract using the listener interfaces (refer to org.hibernate.event.spi) and it ...

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.
Start your free trial

You might also like

Harnessing Hibernate

Harnessing Hibernate

James Elliott, Timothy M. O'Brien, Ryan Fowler
Beginning Hibernate: For Hibernate 5

Beginning Hibernate: For Hibernate 5

Joseph B. Ottinger, Jeff Linwood, Dave Minter
Just Hibernate

Just Hibernate

Madhusudhan Konda
Beginning Hibernate, Third Edition

Beginning Hibernate, Third Edition

Joseph B. Ottinger, Dave Minter, Jeff Linwood

Publisher Resources

ISBN: 9781782175339Supplemental Content