code: public static List<Audit> findByHostName(EntityManager em, String hostName) {
          requireArgument(em != null, "Entity manager cannot be null.");
          requireArgument(hostName != null && !hostName.isEmpty(), "Host name cannot be null or empty.");
  
          TypedQuery<Audit> query = em.createNamedQuery("Audit.findByHostName", Audit.class);
  
          try {
              query.setParameter("hostName", hostName);
              return query.getResultList();
          } catch (NoResultException ex) {
              return new ArrayList<Audit>(0);
          }
      }
docs: Finds all alerts created by given host name.
  
  @param   em        The entity manager. Cannot be null.
  @param   hostName  The name of the host. . Cannot be null or empty.
  
  @return  List of audits created by given host name.