code: private Transactional readTransactionMetadata(MethodInvocation methodInvocation) {
      Transactional transactional;
      Method method = methodInvocation.getMethod();
      Class<?> targetClass = methodInvocation.getThis().getClass();
  
      transactional = method.getAnnotation(Transactional.class);
      if (null == transactional) {
        // If none on method, try the class.
        transactional = targetClass.getAnnotation(Transactional.class);
      }
      if (null == transactional) {
        // If there is no transactional annotation present, use the default
        transactional = Internal.class.getAnnotation(Transactional.class);
      }
  
      return transactional;
    }
docs: TODO(dhanji): Cache this method's results.