protected void addAssetLink( long linkId, long companyId, long userId, String userName, Date createDate, long entryId1, long entryId2, int type, int weight) throws SystemException { AssetLink assetLink = assetLinkPersistence.create(linkId); assetLink.setCompanyId(companyId); assetLink.setUserId(userId); assetLink.setUserName(userName); assetLink.setCreateDate(createDate); assetLink.setEntryId1(entryId1); assetLink.setEntryId2(entryId2); assetLink.setType(type); assetLink.setWeight(weight); assetLinkPersistence.update(assetLink); }
public AssetLink addLink(long userId, long entryId1, long entryId2, int type, int weight) throws PortalException, SystemException { User user = userLocalService.getUser(userId); Date now = new Date(); long linkId = counterLocalService.increment(); AssetLink link = assetLinkPersistence.create(linkId); link.setCompanyId(user.getCompanyId()); link.setUserId(user.getUserId()); link.setUserName(user.getFullName()); link.setCreateDate(now); link.setEntryId1(entryId1); link.setEntryId2(entryId2); link.setType(type); link.setWeight(weight); assetLinkPersistence.update(link, false); return link; }