}
// 2 - Set any annotation defined methods second. We should only add
// add them if they were not overridden in XML.
for (Method method : methods) {
MetadataMethod metadataMethod = getMetadataClass(method.getDeclaringClass()).getMethod(method.getName(), method.getParameterTypes());
// Metadata method can be null when dealing with jdk methods: equals, notify, toString, wait etc..
if (metadataMethod != null) {
if (metadataMethod.isAnnotationPresent(PostLoad.class, classAccessor) && m_postLoad == null) {
setPostLoad(method);
}
if (metadataMethod.isAnnotationPresent(PostPersist.class, classAccessor) && m_postPersist == null) {
setPostPersist(method);
}
if (metadataMethod.isAnnotationPresent(PostRemove.class, classAccessor) && m_postRemove == null) {
setPostRemove(method);
}
if (metadataMethod.isAnnotationPresent(PostUpdate.class, classAccessor) && m_postUpdate == null) {
setPostUpdate(method);
}
if (metadataMethod.isAnnotationPresent(PrePersist.class, classAccessor) && m_prePersist == null) {
setPrePersist(method);
}
if (metadataMethod.isAnnotationPresent(PreRemove.class, classAccessor) && m_preRemove == null) {
setPreRemove(method);
}
if (metadataMethod.isAnnotationPresent(PreUpdate.class, classAccessor) && m_preUpdate == null) {
setPreUpdate(method);
}
}
}
}