Question

I have a class like this:

@Entity
@Customizer(value=UsuarioCustomizer.class)
@Indexes({
    @Index(name="idx_login_senha",columnNames={"usuario","senha"})
})
@EntityListeners({Hashr.class})
public class Usuario implements Serializable{
  private static final long serialVersionUID = 1L;
  // Fields

and here is Hashr

public class Hashr {

    @PrePersist
    @PreUpdate
    public void doHash(Object o){
          // print info
    }
}

but it happens that this method is never called...Any ideas? Did I forgot something?

Was it helpful?

Solution

This should be called. Enable logging on finest and see if any errors are logged.

Ensure you have recompiled/deployed your code.

What environment are you running in? Ensure you list the listener class in your persistence.xml classes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top