public static List<Audit> findByMessage(EntityManager em,String message){
  requireArgument(em != null,"Entity manager cannot be null.");
  requireArgument(message != null && !message.isEmpty(),"Message cannot be null or empty.");
  TypedQuery<Audit> query=em.createNamedQuery("Audit.findByMessage",Audit.class);
  try {
    query.setParameter("message","%" + message + "%");
    return query.getResultList();
  }
 catch (  Exception ex) {
    return new ArrayList<Audit>(0);
  }
}

public static List < Audit > findByMessage ( EntityManager em , String message ) { requireArgument ( em != null , "Entity manager cannot be null." ) ; requireArgument ( message != null && ! message . isEmpty ( ) , "Message cannot be null or empty." ) ; TypedQuery < Audit > query = em . createNamedQuery ( "Audit.findByMessage" , Audit . class ) ; try { query . setParameter ( "message" , "%" + message + "%" ) ; return query . getResultList ( ) ; } catch ( Exception ex ) { return new ArrayList < Audit > ( 0 ) ; } }
finds audits by exception message .
