code: public static List<SuspensionRecord> findByUser(EntityManager em, PrincipalUser user) {
          TypedQuery<SuspensionRecord> query = em.createNamedQuery("SuspensionRecord.findByUser", SuspensionRecord.class);
  
          try {
              query.setParameter("user", user);
              return query.getResultList();
          } catch (NoResultException ex) {
              return new ArrayList<>(0);
          }
      }
docs: Find all suspension records for a given user.
  
  @param   em    The EntityManager to use.
  @param   user  The user for which to retrieve records.
  
  @return  A list of suspension records for the given user. An empty list if no such records exist.