Class RelationEntity<S extends RelatableEntity,T extends RelatableEntity>

java.lang.Object
com.atlassian.core.bean.EntityObject
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. Now in DMZ; see the package-info.java for rationale.

Since:
5.9
See Also:
  • Constructor Details

    • RelationEntity

      public RelationEntity()
  • Method Details

    • 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)
    • getTargetType

      public RelatableEntityTypeEnum getTargetType()
    • setTargetType

      public void setTargetType(RelatableEntityTypeEnum targetType)
    • getSourceType

      public RelatableEntityTypeEnum getSourceType()
    • setSourceType

      public void setSourceType(RelatableEntityTypeEnum sourceType)
    • getRelationName

      public String getRelationName()
    • setRelationName

      public void setRelationName(String relationName)