Exemplo n.º 1
0
 public void executeInTransaction() throws SQLException, ValidationException {
   Category exists = CategoryDAO.getCategory(this.name);
   if (exists != null && exists.getId() != this.oid) {
     throw new ValidationException(new ValidationError(ValidationErrors.CATEGORY_ALREADY_EXISTS));
   }
   Category toModify = CategoryDAO.getCategory(this.oid);
   toModify.setName(this.name);
   toModify.setDeleted(false);
   CategoryDAO.updateCategory(toModify);
 }
Exemplo n.º 2
0
 public static List selectAllReferenceDocumentForCategory(Category category) throws SQLException {
   return IBatisManager.sqlMapper.queryForList(
       "selectAllReferenceDocumentsNotDeletedForCategory", category.getId());
 }