/** * Removes the relation (and its inverse in case of a bidirectional relation) from the database. * * @param relation the relation to be removed * @throws PortalException if the relation is bidirectional and its inverse relation could not be * found * @throws SystemException if a system exception occurred */ public void deleteRelation(SocialRelation relation) throws PortalException, SystemException { socialRelationPersistence.remove(relation); if (SocialRelationConstants.isTypeBi(relation.getType())) { SocialRelation biRelation = socialRelationPersistence.findByU1_U2_T( relation.getUserId2(), relation.getUserId1(), relation.getType()); socialRelationPersistence.remove(biRelation); } }
protected void reindex(SocialRelation socialRelation) { SocialRelationReindexerCallable socialRelationReindexerCallable = _socialRelationReindexerCallable.get(); if (socialRelationReindexerCallable == null) { socialRelationReindexerCallable = new SocialRelationReindexerCallable(); TransactionCommitCallbackRegistryUtil.registerCallback(socialRelationReindexerCallable); _socialRelationReindexerCallable.set(socialRelationReindexerCallable); } socialRelationReindexerCallable.addUserId(socialRelation.getUserId1()); socialRelationReindexerCallable.addUserId(socialRelation.getUserId2()); }