コード例 #1
0
 @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());
 }
コード例 #2
0
 @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");
 }