public Link updateLink(Link link) throws SystemException {
   Link model = linkPersistence.fetchByPrimaryKey(link.getLinkId());
   model.setUserId(link.getUserId());
   model.setCompanyId(link.getCompanyId());
   model.setApplicationId(link.getApplicationId());
   model.setDisplayName(link.getDisplayName());
   model.setType(link.getType());
   model.setUrl(link.getUrl());
   model.setModifiedDate(new Date());
   return linkPersistence.update(model, true);
 }
 public Link addLink(Link link) throws SystemException {
   _log.debug("addLink");
   long linkId = CounterLocalServiceUtil.increment(Link.class.getName());
   Link model = linkPersistence.create(linkId);
   model.setUserId(link.getUserId());
   model.setCompanyId(link.getCompanyId());
   model.setCreateDate(new Date());
   model.setModifiedDate(new Date());
   model.setApplicationId(link.getApplicationId());
   model.setDisplayName(link.getDisplayName());
   model.setType(link.getType());
   model.setUrl(link.getUrl());
   return linkPersistence.update(model, true);
 }