public int updateViews(Integer id) {
   CmsFriendlink link = findById(id);
   if (link != null) {
     link.setViews(link.getViews() + 1);
   }
   return link.getViews();
 }
 public CmsFriendlink update(CmsFriendlink bean, Integer ctgId) {
   Updater<CmsFriendlink> updater = new Updater<CmsFriendlink>(bean);
   bean = dao.updateByUpdater(updater);
   if (ctgId != null) {
     bean.setCategory(cmsFriendlinkCtgMng.findById(ctgId));
   }
   bean.blankToNull();
   return bean;
 }
 public void updatePriority(Integer[] ids, Integer[] priorities) {
   if (ids == null || priorities == null || ids.length <= 0 || ids.length != priorities.length) {
     return;
   }
   CmsFriendlink link;
   for (int i = 0, len = ids.length; i < len; i++) {
     link = findById(ids[i]);
     link.setPriority(priorities[i]);
   }
 }
 public CmsFriendlink save(CmsFriendlink bean, Integer ctgId) {
   bean.setCategory(cmsFriendlinkCtgMng.findById(ctgId));
   bean.init();
   dao.save(bean);
   return bean;
 }