code: private Field findFieldInClass(Class klass, String fieldName) throws NoSuchFieldException {
          try {
              return klass.getDeclaredField(fieldName);
          } catch (NoSuchFieldException e) {
              Class superclass = klass.getSuperclass();
              if (superclass != null) {
                  return findFieldInClass(superclass, fieldName);
              }
              throw new NoSuchFieldException();
          }
      }
docs: Search field in class/superclasses
  
  @param klass Class to search
  @param fieldName Field to search
  @return Field with @RecordId
  
  @throws NoSuchFieldException if field isn't found