예제 #1
0
 /**
  * Saves a filterCategoryBean in the database
  *
  * @param filterCategoryBean
  * @return
  */
 @Override
 public Integer save(TReportCategoryBean reportCategoryBean) {
   TReportCategory filterCategory;
   try {
     filterCategory = BaseTReportCategory.createTReportCategory(reportCategoryBean);
     filterCategory.save();
     return filterCategory.getObjectID();
   } catch (Exception e) {
     LOGGER.error("Saving of a filterCategory failed with " + e.getMessage());
     return null;
   }
 }
예제 #2
0
 /**
  * Deletes the reportCategoryBean satisfying a certain criteria together with the dependent
  * database entries
  *
  * @param crit
  * @throws TorqueException
  */
 public static void doDelete(Criteria crit) throws TorqueException {
   List list = null;
   try {
     list = doSelect(crit);
   } catch (TorqueException e) {
     LOGGER.error(
         "Getting the list of TReportCategoryBean to be deleted failed with " + e.getMessage());
     throw e;
   }
   if (list != null && !list.isEmpty()) {
     Iterator<TReportCategory> iter = list.iterator();
     TReportCategory filterCategory = null;
     while (iter.hasNext()) {
       filterCategory = iter.next();
       ReflectionHelper.delete(deletePeerClasses, deleteFields, filterCategory.getObjectID());
     }
   }
 }