dynamicQuery.setLimit(start, start + count);
return dynamicQuery(dynamicQuery);
}
public void cleanUpWarrantsDeletedBefore(Date before) throws NoSuchWarrantException, SystemException {
DynamicQuery dynamicQuery = createDynamicQuery()
.add(RestrictionsFactoryUtil.eq("status", WarrantStateType.DELETED.name()))
.add(RestrictionsFactoryUtil.le("modifiedDate", before));
List<Warrant> warrants = dynamicQuery(dynamicQuery);
for (Warrant warrant : warrants) {
WarrantUtil.remove(warrant.getId());