Class RelationEntity<S extends RelatableEntity,T extends RelatableEntity>
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.AnnotatedEntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.dmz.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. Now in DMZ; see the package-info.java for rationale.
- Since:
- 5.9
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetId()voidsetId(long id) voidsetRelationName(String relationName) voidsetSourceContent(S sourceContent) voidsetSourceType(RelatableEntityTypeEnum sourceType) voidsetTargetContent(T targetContent) voidsetTargetType(RelatableEntityTypeEnum targetType) Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setLastModifierMethods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObject
clone, equals, getCurrentDate, hashCode, setClock, setCreationDate, setLastModificationDate
-
Constructor Details
-
RelationEntity
public RelationEntity()
-
-
Method Details
-
getId
public long getId()- Overrides:
getIdin classcom.atlassian.core.bean.EntityObject
-
setId
public void setId(long id) - Overrides:
setIdin classcom.atlassian.core.bean.EntityObject
-
getTargetContent
-
setTargetContent
-
getSourceContent
-
setSourceContent
-
getTargetType
-
setTargetType
-
getSourceType
-
setSourceType
-
getRelationName
-
setRelationName
-