I have this class the problem arises when I persist an instance does not recognize the listener and does not perform the action before persisting.
You can try the @PrePersist annotation, it will run automatically before inserting into the database. And you create the method that you want to be executed during that action. It would be something like this:
@PrePersist
private void metodoAEjecutar() {
//Código a ejecutar
}