@Override public void edit(Menu menu) { if (menu.getId() == null) throw new IllegalArgumentException("id argument is null"); if (menu.getTitle() == null) throw new IllegalArgumentException("title argument is null"); if (menu.getPid() == null) throw new IllegalArgumentException("pid argument is null"); if (menu.getUrl() == null) throw new IllegalArgumentException("url argument is null"); if (menu.getSorder() == null) throw new IllegalArgumentException("sorder argument is null"); menu.setDeleteflag(0); this.baseDaoSupport.update("menu", menu, "id=" + menu.getId()); }
@Override public Integer add(Menu menu) { if (menu.getTitle() == null) throw new IllegalArgumentException("title argument is null"); if (menu.getPid() == null) throw new IllegalArgumentException("pid argument is null"); if (menu.getUrl() == null) throw new IllegalArgumentException("url argument is null"); if (menu.getSorder() == null) throw new IllegalArgumentException("sorder argument is null"); menu.setDeleteflag(0); this.baseDaoSupport.insert("menu", menu); return this.baseDaoSupport.getLastId("menu"); }