While migrating a project of mine from JPA2 to Avaje Ebean, I encountered a issue, I wasn’t expecting.
Avaje Ebean does not support the JPA EntityListener Annotations, like
@PrePersist,
@PostPersist,
@PreUpdate,
@PostUpdate,
@PostLoad
Some nice folks on the Ebean Mailinglist directed me to some Documentation about EntityListeners in Ebean including a helpful forum link which finally pointed me to the BeanPersistController Interface in the Ebean Java API .
With that Information, I was able to create a EntityListener that enables the use of the JPA EntityListener Annotations with Ebean.
This Gist shows how I’ve done it:
Questions? Comments? Forks?
I appreciate any kind of feedback! 🙂