Class RelationEntity<S extends RelatableEntity,​T extends RelatableEntity>

  • All Implemented Interfaces:
    Serializable, Cloneable
    Direct Known Subclasses:
    Content2ContentRelationEntity, User2ContentRelationEntity, User2UserRelationEntity

    public abstract class RelationEntity<S extends RelatableEntity,​T extends RelatableEntity>
    extends ConfluenceEntityObject
    implements Serializable
    This class represents "relation" abstraction, which is used for "marking" different entities as related. So far relations of types "user2content", "user2user" and "content2content" are supported Good examples of relations are Watches (when user marks certain pages as watchable), Likes (user marks content as "Liked") or Favourites (content is marked as favourite by user) (all are "user2content" type of relations).

    It is very similar to the content properties, but the very important difference is that for given page we're not interested for all relations, but only if it is related with one particular entity (f.e. to show the page we don't need to know all the users who "favourited" this page, we just need to know if the current user did). At the same time we need to fetch all the contentproperties to render the page properly.

    So it was decided to create generic relation service to feed and serve "relational" functionality efficiently.

    Since:
    5.9
    See Also:
    Serialized Form
    • Constructor Detail

      • RelationEntity

        public RelationEntity()
    • Method Detail

      • getId

        public long getId()
        Overrides:
        getId in class com.atlassian.core.bean.EntityObject
      • setId

        public void setId​(long id)
        Overrides:
        setId in class com.atlassian.core.bean.EntityObject
      • getTargetContent

        public T getTargetContent()
      • setTargetContent

        public void setTargetContent​(T targetContent)
      • getSourceContent

        public S getSourceContent()
      • setSourceContent

        public void setSourceContent​(S sourceContent)
      • getRelationName

        public String getRelationName()
      • setRelationName

        public void setRelationName​(String relationName)