code: private void addNamedNativeQueryMetadata(Class clazz)
      {
          ApplicationMetadata appMetadata = kunderaMetadata.getApplicationMetadata();
          String name, query = null;
          if (clazz.isAnnotationPresent(NamedQuery.class))
          {
              NamedQuery ann = (NamedQuery) clazz.getAnnotation(NamedQuery.class);
              appMetadata.addQueryToCollection(ann.name(), ann.query(), false, clazz);
          }
  
          if (clazz.isAnnotationPresent(NamedQueries.class))
          {
              NamedQueries ann = (NamedQueries) clazz.getAnnotation(NamedQueries.class);
  
              NamedQuery[] anns = ann.value();
              for (NamedQuery a : anns)
              {
                  appMetadata.addQueryToCollection(a.name(), a.query(), false, clazz);
              }
          }
  
          if (clazz.isAnnotationPresent(NamedNativeQuery.class))
          {
              NamedNativeQuery ann = (NamedNativeQuery) clazz.getAnnotation(NamedNativeQuery.class);
              appMetadata.addQueryToCollection(ann.name(), ann.query(), true, clazz);
          }
  
          if (clazz.isAnnotationPresent(NamedNativeQueries.class))
          {
              NamedNativeQueries ann = (NamedNativeQueries) clazz.getAnnotation(NamedNativeQueries.class);
  
              NamedNativeQuery[] anns = ann.value();
              for (NamedNativeQuery a : anns)
              {
                  appMetadata.addQueryToCollection(a.name(), a.query(), true, clazz);
              }
          }
      }
docs: Add named/native query annotated fields to application meta data.
  
  @param clazz
  entity class.