public void saveCategory(List<Category> categories) throws DuplicateKeyException {
   boolean duplicateKeyException = false;
   for (Category category : categories) {
     try {
       super.save(category);
     } catch (DuplicateKeyException e) {
       duplicateKeyException = true;
       e.printStackTrace();
     }
   }
   if (duplicateKeyException) {
     throw new DuplicateKeyException();
   }
 }
 public void deleteCategoriesWithMapping(MappingSetup setup) {
   for (Category category : getAllCategories(setup)) {
     super.delete(category);
   }
 }
 public void saveCategory(Category category) throws DuplicateKeyException {
   super.save(category);
 }