protected boolean processAnnotations(Method method, JpaEntityListener listener) {
boolean hasListenerAnnotations = false;
if (method.isAnnotationPresent(PrePersist.class)) {
listener.setPrePersist(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
if (method.isAnnotationPresent(PostPersist.class)) {
listener.setPostPersist(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
if (method.isAnnotationPresent(PreRemove.class)) {
listener.setPreRemove(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
if (method.isAnnotationPresent(PostRemove.class)) {
listener.setPostRemove(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
if (method.isAnnotationPresent(PreUpdate.class)) {
listener.setPreUpdate(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
if (method.isAnnotationPresent(PostUpdate.class)) {
listener.setPostUpdate(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
if (method.isAnnotationPresent(PostLoad.class)) {
listener.setPostLoad(new JpaLifecycleCallback(method.getName()));
hasListenerAnnotations = true;
}
return hasListenerAnnotations;
}