@BufferedIncrement(incrementClass = SocialEquityIncrement.class) public void incrementSocialEquityUser_PQ( long groupId, long userId, SocialEquityValue socialEquityValue) throws PortalException, SystemException { User user = userLocalService.getUser(userId); int count = socialEquityUserPersistence.countByG_U(groupId, userId); if (count == 0) { addSocialEquityUser(groupId, user); } user.updateSocialParticipationEquity(socialEquityValue.getValue()); String sql = CustomSQLUtil.get(_UPDATE_SOCIAL_EQUITY_USER_PQ); sql = StringUtil.replace( sql, new String[] { "[$GROUP_ID$]", "[$PARTICIPATION_B$]", "[$PARTICIPATION_K$]", "[$USER_ID$]" }, new String[] { String.valueOf(groupId), String.valueOf(socialEquityValue.getB()), String.valueOf(socialEquityValue.getK()), String.valueOf(userId) }); runSQL(sql); }
@BufferedIncrement(incrementClass = SocialEquityIncrement.class) public void incrementSocialEquityAssetEntry_IQ( long assetEntryId, SocialEquityValue socialEquityValue) throws SystemException { AssetEntry assetEntry = assetEntryPersistence.fetchByPrimaryKey(assetEntryId); assetEntry.updateSocialInformationEquity(socialEquityValue.getValue()); int count = socialEquityAssetEntryPersistence.countByAssetEntryId(assetEntryId); if (count == 0) { addSocialEquityAssetEntry(assetEntry); } String sql = CustomSQLUtil.get(_UPDATE_SOCIAL_EQUITY_ASSET_ENTRY_IQ); sql = StringUtil.replace( sql, new String[] {"[$ASSET_ENTRY_ID$]", "[$INFORMATION_B$]", "[$INFORMATION_K$]"}, new String[] { String.valueOf(assetEntryId), String.valueOf(socialEquityValue.getB()), String.valueOf(socialEquityValue.getK()) }); runSQL(sql); }