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 ( ) ; }
Delete old jobs .