//if we have the maxBusinesses set for this publisher then we need to make sure we did not exceed it.
if (maxBusinesses > 0) {
//get the businesses owned by this publisher
List<?> businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, null);
if (businessKeysFound != null && businessKeysFound.size() > maxBusinesses) {
throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxBusinessesExceeded"));
}
}
}