I'm having this error on my console ...
Caused by: javax.persistence.PersistenceException: Callback methods annotated in a listener bean class must return void and take one argument: javax.persistence.PreUpdate - public void digifred.model.aud.global.LogradourosEntityListener.preUpdate(digifred.model.global.Logradouros,java.util.Date)
at org.hibernate.jpa.event.internal.jpa.CallbackBuilderLegacyImpl.resolveCallbacks(CallbackBuilderLegacyImpl.java:180) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.jpa.event.internal.jpa.CallbackBuilderLegacyImpl.buildCallbacksForEntity(CallbackBuilderLegacyImpl.java:69) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
I'm not sure how to identify my error ..
public class LogradourosEntityListener {
@PrePersist
public void prePersist(Logradouros target, Date modifiedDate) {
perform(target,Acoes.INSERTED, modifiedDate);
}
@PreUpdate
public void preUpdate(Logradouros target, Date modifiedDate) {
perform(target, Acoes.UPDATED, modifiedDate);
}
@PreRemove
public void preRemove(Logradouros target,Date modifiedDate) {
perform(target, Acoes.DELETED, modifiedDate);
}
@Transactional()
private void perform(Logradouros target, Acoes acao, Date modifiedDate) {
EntityManager entityManager = BeanUtil.getBean(EntityManager.class);
entityManager.persist(new LogradourosHistorico(target, acao, modifiedDate));
}
}