Skip to main content

Micha Kops: Adding multiple EntityListeners to an Entity in JPA 2

The ability to attach lifecycle events to an entity using simple annotations sometimes is a neat feature in the Java Persistence API. The following short snippets demonstrate how to bind and trigger the different available lifecycle events using an embedded derby database and a bunch of annotations...

Community: Java Enterprise