Search in sources :

Example 1 with MethodInfo

use of org.neo4j.ogm.metadata.MethodInfo in project neo4j-ogm by neo4j.

the class GraphEntityMapper method executePostLoad.

private void executePostLoad(Object instance) {
    ClassInfo classInfo = metadata.classInfo(instance);
    MethodInfo postLoadMethod = classInfo.postLoadMethodOrNull();
    if (postLoadMethod == null) {
        return;
    }
    try {
        postLoadMethod.invoke(instance);
    } catch (SecurityException e) {
        logger.warn("Cannot call PostLoad annotated method {} on class {}, " + "security manager denied access.", postLoadMethod.getMethod().getName(), classInfo.name(), e);
    } catch (IllegalAccessException | InvocationTargetException e) {
        logger.warn("Cannot call PostLoad annotated method {} on class {}. " + "Make sure it is public and has no arguments", postLoadMethod.getMethod().getName(), classInfo.name(), e);
    }
}
Also used : MethodInfo(org.neo4j.ogm.metadata.MethodInfo) InvocationTargetException(java.lang.reflect.InvocationTargetException) ClassInfo(org.neo4j.ogm.metadata.ClassInfo)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ClassInfo (org.neo4j.ogm.metadata.ClassInfo)1 MethodInfo (org.neo4j.ogm.metadata.MethodInfo)1