code: public static int deleteExpiredHistory(EntityManager em) {
          requireArgument(em != null, "Entity manager cannot be null.");
  
          Query query = em.createNamedQuery("History.cullExpired");
  
          query.setParameter("expiryTime", System.currentTimeMillis() - (2 * MILLIS_PER_WEEK));
          return query.executeUpdate();
      }
docs: Deletes the old job history.
  
  @param   em  Entity manager. Cannot be null.
  
  @return  no. of job history records deleted.