Пример #1
0
 public String reSavePress() {
   String hql = "from Press p order by p.id";
   List<Press> presses = getManager().query(hql);
   for (Press p : presses) {
     p.setName(StringUtils.trim(p.getName()));
     getManager().save(p);
   }
   return SUCCESS;
 }
Пример #2
0
  /** 删除出版社 */
  @Override
  public String remove() {
    Press press = getManager().get(getModel().getId());
    if (press.getBooks().size() != 0) {
      addActionError("该出版社涉及图书信息,不能删除!");
      return INDEX;
    }

    return super.remove();
  }