code: private void onSuperClass(Class<?> clazz, List<Field> keys)
      {
  
          Class<?> superClass = clazz.getSuperclass();
          if (superClass != null
                  && (superClass.isAnnotationPresent(MappedSuperclass.class) || superClass
                          .isAnnotationPresent(Entity.class)))
          {
  
              while (superClass != null
                      && (superClass.isAnnotationPresent(MappedSuperclass.class) || superClass
                              .isAnnotationPresent(Entity.class)))
              {
                  for (Field field : superClass.getDeclaredFields())
                  {
  
  //                    if (checkValidField(field))
  //                    {
  
                          onIdField(field, superClass);
                          if (field.isAnnotationPresent(Id.class))
                          {
                              keys.add(field);
                              // validate @GeneratedValue annotation if given
                              if (field.isAnnotationPresent(GeneratedValue.class))
                              {
                                  validateGeneratedValueAnnotation(superClass, field);
                              }
                          }
                          else if (field.isAnnotationPresent(EmbeddedId.class))
                          {
                              keys.add(field);
                          }
  
                     // }
                  }
  
                  if (keys.size() > 0)
                  {
                      onEntityKey(keys, superClass);
                      break;
                  }
                  superClass = superClass.getSuperclass();
  
              }
          }
  
          onEntityKey(keys, clazz);
  
      }
docs: Checks whether the defined class is a validone with an id field present
  either in class itself or its superclass
  
  @param clazz
  @param keys
  @throws RuleValidationException