code: public static Field findField(Class<?> clazz, String name) {
          Class<?> entityClass = clazz;
          while (!Object.class.equals(entityClass) && entityClass != null) {
              Field[] fields = entityClass.getDeclaredFields();
              for (Field field : fields) {
                  if (name.equals(field.getName())) {
                      return field;
                  }
              }
              entityClass = entityClass.getSuperclass();
          }
          return null;
      }
docs: tries to find a field by a field name
  
  @param clazz type
  @param name name of the field
  @return