public Object execute(QueryInvocationContext context) throws Exception {
InvocationContext invocation = context.getInvocation();
if (EntityDaoHandler.contains(invocation.getMethod())) {
return callEntityHandler(invocation, context.getEntityClass(), context.getEntityManager());
}
return invocation.proceed();
}
private Object callEntityHandler(InvocationContext ctx, Class<?> entityClass, EntityManager entityManager)
throws Exception {
return EntityDaoHandler.create(entityManager, entityClass).invoke(ctx.getMethod(), ctx.getParameters());