code: public final int deleteOld(final long checkTimeThreshold) {
          final CriteriaBuilder builder = getSession().getCriteriaBuilder();
          final CriteriaDelete<PrintJobStatusExtImpl> delete =
                  builder.createCriteriaDelete(PrintJobStatusExtImpl.class);
          final Root<PrintJobStatusExtImpl> root = delete.from(PrintJobStatusExtImpl.class);
          delete.where(builder.and(builder.isNotNull(root.get("lastCheckTime")),
                                   builder.lessThan(root.get("lastCheckTime"), checkTimeThreshold)));
          return getSession().createQuery(delete).executeUpdate();
      }
docs: Delete old jobs.
  
  @param checkTimeThreshold threshold for last check time
  @return the number of jobs deleted