Class SocialRelationLocalServiceWrapper

Object
com.liferay.social.kernel.service.SocialRelationLocalServiceWrapper
All Implemented Interfaces:
BaseLocalService, CTService<SocialRelation>, PersistedModelLocalService, ServiceWrapper<SocialRelationLocalService>, SocialRelationLocalService

public class SocialRelationLocalServiceWrapper extends Object implements ServiceWrapper<SocialRelationLocalService>, SocialRelationLocalService
Provides a wrapper for SocialRelationLocalService.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Constructor Details

    • SocialRelationLocalServiceWrapper

      public SocialRelationLocalServiceWrapper()
    • SocialRelationLocalServiceWrapper

      public SocialRelationLocalServiceWrapper(SocialRelationLocalService socialRelationLocalService)
  • Method Details

    • addRelation

      public SocialRelation addRelation(long userId1, long userId2, int type) throws PortalException
      Adds a social relation between the two users to the database.
      Specified by:
      addRelation in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      type - the type of the relation
      Returns:
      the social relation
      Throws:
      PortalException
    • addSocialRelation

      public SocialRelation addSocialRelation(SocialRelation socialRelation)
      Adds the social relation to the database. Also notifies the appropriate model listeners.

      Important: Inspect SocialRelationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      addSocialRelation in interface SocialRelationLocalService
      Parameters:
      socialRelation - the social relation
      Returns:
      the social relation that was added
    • createPersistedModel

      public PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      createPersistedModel in interface PersistedModelLocalService
      Specified by:
      createPersistedModel in interface SocialRelationLocalService
      Throws:
      PortalException
      PortalException
    • createSocialRelation

      public SocialRelation createSocialRelation(long relationId)
      Creates a new social relation with the primary key. Does not add the social relation to the database.
      Specified by:
      createSocialRelation in interface SocialRelationLocalService
      Parameters:
      relationId - the primary key for the new social relation
      Returns:
      the new social relation
    • deletePersistedModel

      public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Specified by:
      deletePersistedModel in interface PersistedModelLocalService
      Specified by:
      deletePersistedModel in interface SocialRelationLocalService
      Throws:
      PortalException
      PortalException
    • deleteRelation

      public void deleteRelation(long relationId) throws PortalException
      Removes the relation (and its inverse in case of a bidirectional relation) from the database.
      Specified by:
      deleteRelation in interface SocialRelationLocalService
      Parameters:
      relationId - the primary key of the relation
      Throws:
      PortalException
    • deleteRelation

      public void deleteRelation(long userId1, long userId2, int type) throws PortalException
      Removes the matching relation (and its inverse in case of a bidirectional relation) from the database.
      Specified by:
      deleteRelation in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      type - the relation's type
      Throws:
      PortalException
    • deleteRelation

      public void deleteRelation(SocialRelation relation) throws PortalException
      Removes the relation (and its inverse in case of a bidirectional relation) from the database.
      Specified by:
      deleteRelation in interface SocialRelationLocalService
      Parameters:
      relation - the relation to be removed
      Throws:
      PortalException
    • deleteRelations

      public void deleteRelations(long userId)
      Removes all relations involving the user from the database.
      Specified by:
      deleteRelations in interface SocialRelationLocalService
      Parameters:
      userId - the primary key of the user
    • deleteRelations

      public void deleteRelations(long userId1, long userId2) throws PortalException
      Removes all relations between User1 and User2.
      Specified by:
      deleteRelations in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      Throws:
      PortalException
    • deleteSocialRelation

      public SocialRelation deleteSocialRelation(long relationId) throws PortalException
      Deletes the social relation with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect SocialRelationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      deleteSocialRelation in interface SocialRelationLocalService
      Parameters:
      relationId - the primary key of the social relation
      Returns:
      the social relation that was removed
      Throws:
      PortalException - if a social relation with the primary key could not be found
      PortalException
    • deleteSocialRelation

      public SocialRelation deleteSocialRelation(SocialRelation socialRelation)
      Deletes the social relation from the database. Also notifies the appropriate model listeners.

      Important: Inspect SocialRelationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      deleteSocialRelation in interface SocialRelationLocalService
      Parameters:
      socialRelation - the social relation
      Returns:
      the social relation that was removed
    • dslQuery

      public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQuery in interface PersistedModelLocalService
      Specified by:
      dslQuery in interface SocialRelationLocalService
    • dslQueryCount

      public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQueryCount in interface PersistedModelLocalService
      Specified by:
      dslQueryCount in interface SocialRelationLocalService
    • dynamicQuery

      public DynamicQuery dynamicQuery()
      Specified by:
      dynamicQuery in interface SocialRelationLocalService
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Specified by:
      dynamicQuery in interface SocialRelationLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
      Performs a dynamic query on the database and returns a range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.social.model.impl.SocialRelationModelImpl.

      Specified by:
      dynamicQuery in interface SocialRelationLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
      Performs a dynamic query on the database and returns an ordered range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.social.model.impl.SocialRelationModelImpl.

      Specified by:
      dynamicQuery in interface SocialRelationLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface SocialRelationLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface SocialRelationLocalService
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchSocialRelation

      public SocialRelation fetchSocialRelation(long relationId)
      Specified by:
      fetchSocialRelation in interface SocialRelationLocalService
    • fetchSocialRelationByUuidAndCompanyId

      public SocialRelation fetchSocialRelationByUuidAndCompanyId(String uuid, long companyId)
      Returns the social relation with the matching UUID and company.
      Specified by:
      fetchSocialRelationByUuidAndCompanyId in interface SocialRelationLocalService
      Parameters:
      uuid - the social relation's UUID
      companyId - the primary key of the company
      Returns:
      the matching social relation, or null if a matching social relation could not be found
    • getActionableDynamicQuery

      public ActionableDynamicQuery getActionableDynamicQuery()
      Specified by:
      getActionableDynamicQuery in interface SocialRelationLocalService
    • getIndexableActionableDynamicQuery

      public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
      Specified by:
      getIndexableActionableDynamicQuery in interface SocialRelationLocalService
    • getInverseRelations

      public List<SocialRelation> getInverseRelations(long userId, int type, int start, int end)
      Returns a range of all the inverse relations of the given type for which the user is User2 of the relation.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

      Specified by:
      getInverseRelations in interface SocialRelationLocalService
      Parameters:
      userId - the primary key of the user
      type - the relation's type
      start - the lower bound of the range of results
      end - the upper bound of the range of results (not inclusive)
      Returns:
      the range of matching relations
    • getInverseRelationsCount

      public int getInverseRelationsCount(long userId, int type)
      Returns the number of inverse relations of the given type for which the user is User2 of the relation.
      Specified by:
      getInverseRelationsCount in interface SocialRelationLocalService
      Parameters:
      userId - the primary key of the user
      type - the relation's type
      Returns:
      the number of matching relations
    • getOSGiServiceIdentifier

      public String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Specified by:
      getOSGiServiceIdentifier in interface SocialRelationLocalService
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      getPersistedModel in interface PersistedModelLocalService
      Specified by:
      getPersistedModel in interface SocialRelationLocalService
      Throws:
      PortalException
      PortalException
    • getRelation

      public SocialRelation getRelation(long relationId) throws PortalException
      Returns the relation identified by its primary key.
      Specified by:
      getRelation in interface SocialRelationLocalService
      Parameters:
      relationId - the primary key of the relation
      Returns:
      Returns the relation
      Throws:
      PortalException
    • getRelation

      public SocialRelation getRelation(long userId1, long userId2, int type) throws PortalException
      Returns the relation of the given type between User1 and User2.
      Specified by:
      getRelation in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      type - the relation's type
      Returns:
      Returns the relation
      Throws:
      PortalException
    • getRelations

      public List<SocialRelation> getRelations(long userId, int type, int start, int end)
      Returns a range of all the relations of the given type where the user is the subject of the relation.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

      Specified by:
      getRelations in interface SocialRelationLocalService
      Parameters:
      userId - the primary key of the user
      type - the relation's type
      start - the lower bound of the range of results
      end - the upper bound of the range of results (not inclusive)
      Returns:
      the range of relations
    • getRelations

      public List<SocialRelation> getRelations(long userId1, long userId2, int start, int end)
      Returns a range of all the relations between User1 and User2.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

      Specified by:
      getRelations in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      start - the lower bound of the range of results
      end - the upper bound of the range of results (not inclusive)
      Returns:
      the range of relations
    • getRelationsCount

      public int getRelationsCount(long userId, int type)
      Returns the number of relations of the given type where the user is the subject of the relation.
      Specified by:
      getRelationsCount in interface SocialRelationLocalService
      Parameters:
      userId - the primary key of the user
      type - the relation's type
      Returns:
      the number of relations
    • getRelationsCount

      public int getRelationsCount(long userId1, long userId2)
      Returns the number of relations between User1 and User2.
      Specified by:
      getRelationsCount in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      Returns:
      the number of relations
    • getSocialRelation

      public SocialRelation getSocialRelation(long relationId) throws PortalException
      Returns the social relation with the primary key.
      Specified by:
      getSocialRelation in interface SocialRelationLocalService
      Parameters:
      relationId - the primary key of the social relation
      Returns:
      the social relation
      Throws:
      PortalException - if a social relation with the primary key could not be found
      PortalException
    • getSocialRelationByUuidAndCompanyId

      public SocialRelation getSocialRelationByUuidAndCompanyId(String uuid, long companyId) throws PortalException
      Returns the social relation with the matching UUID and company.
      Specified by:
      getSocialRelationByUuidAndCompanyId in interface SocialRelationLocalService
      Parameters:
      uuid - the social relation's UUID
      companyId - the primary key of the company
      Returns:
      the matching social relation
      Throws:
      PortalException - if a matching social relation could not be found
      PortalException
    • getSocialRelations

      public List<SocialRelation> getSocialRelations(int start, int end)
      Returns a range of all the social relations.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portlet.social.model.impl.SocialRelationModelImpl.

      Specified by:
      getSocialRelations in interface SocialRelationLocalService
      Parameters:
      start - the lower bound of the range of social relations
      end - the upper bound of the range of social relations (not inclusive)
      Returns:
      the range of social relations
    • getSocialRelationsCount

      public int getSocialRelationsCount()
      Returns the number of social relations.
      Specified by:
      getSocialRelationsCount in interface SocialRelationLocalService
      Returns:
      the number of social relations
    • hasRelation

      public boolean hasRelation(long userId1, long userId2, int type)
      Returns true if a relation of the given type exists where the user with primary key userId1 is User1 of the relation and the user with the primary key userId2 is User2 of the relation.
      Specified by:
      hasRelation in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      type - the relation's type
      Returns:
      true if the relation exists; false otherwise
    • isRelatable

      public boolean isRelatable(long userId1, long userId2, int type)
      Returns true if the users can be in a relation of the given type where the user with primary key userId1 is User1 of the relation and the user with the primary key userId2 is User2 of the relation.

      This method returns false if User1 and User2 are the same, if either user is the default user, or if a matching relation already exists.

      Specified by:
      isRelatable in interface SocialRelationLocalService
      Parameters:
      userId1 - the user that is the subject of the relation
      userId2 - the user at the other end of the relation
      type - the relation's type
      Returns:
      true if the two users can be in a new relation of the given type; false otherwise
    • updateSocialRelation

      public SocialRelation updateSocialRelation(SocialRelation socialRelation)
      Updates the social relation in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect SocialRelationLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      updateSocialRelation in interface SocialRelationLocalService
      Parameters:
      socialRelation - the social relation
      Returns:
      the social relation that was updated
    • getBasePersistence

      public BasePersistence<?> getBasePersistence()
      Specified by:
      getBasePersistence in interface PersistedModelLocalService
    • getCTPersistence

      public CTPersistence<SocialRelation> getCTPersistence()
      Specified by:
      getCTPersistence in interface CTService<SocialRelation>
      Specified by:
      getCTPersistence in interface SocialRelationLocalService
    • getModelClass

      public Class<SocialRelation> getModelClass()
      Specified by:
      getModelClass in interface CTService<SocialRelation>
      Specified by:
      getModelClass in interface SocialRelationLocalService
    • updateWithUnsafeFunction

      public <R, E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<SocialRelation>,R,E> updateUnsafeFunction) throws E
      Specified by:
      updateWithUnsafeFunction in interface CTService<SocialRelation>
      Specified by:
      updateWithUnsafeFunction in interface SocialRelationLocalService
      Throws:
      E extends Throwable
    • getWrappedService

      public SocialRelationLocalService getWrappedService()
      Specified by:
      getWrappedService in interface ServiceWrapper<SocialRelationLocalService>
    • setWrappedService

      public void setWrappedService(SocialRelationLocalService socialRelationLocalService)
      Specified by:
      setWrappedService in interface ServiceWrapper<SocialRelationLocalService>