Class RelationEntity<S extends RelatableEntity,T extends RelatableEntity>
- java.lang.Object
-
- com.atlassian.core.bean.EntityObject
-
- com.atlassian.confluence.core.ConfluenceEntityObject
-
- com.atlassian.confluence.internal.relations.dao.RelationEntity<S,T>
-
- 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 Summary
Constructors Constructor Description RelationEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getId()
String
getRelationName()
S
getSourceContent()
RelatableEntityTypeEnum
getSourceType()
T
getTargetContent()
RelatableEntityTypeEnum
getTargetType()
void
setId(long id)
void
setRelationName(String relationName)
void
setSourceContent(S sourceContent)
void
setSourceType(RelatableEntityTypeEnum sourceType)
void
setTargetContent(T targetContent)
void
setTargetType(RelatableEntityTypeEnum targetType)
-
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName
-
-
-
-
Method Detail
-
getId
public long getId()
- Overrides:
getId
in classcom.atlassian.core.bean.EntityObject
-
setId
public void setId(long id)
- Overrides:
setId
in classcom.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)
-
-