public class Content2ContentHibernateRelationDao extends HibernateRelationDao<ContentEntityObject,ContentEntityObject>
hibernate, RELATION_PARAM_NAME, sessionFactory, SOURCE_PARAM_NAME, TARGET_PARAM_NAME
Constructor and Description |
---|
Content2ContentHibernateRelationDao(org.hibernate.SessionFactory sessionFactory) |
Modifier and Type | Method and Description |
---|---|
List<Long> |
getAllRelationIdsForContentInSpace(String spaceKey,
Collection<ConfluenceEntityObject> exclusions,
int start,
int limit)
This method returns ids of all content relation entities in space.
|
Content2ContentRelationEntity |
getRelationEntity(ContentEntityObject source,
ContentEntityObject target,
RelationDescriptor relationDescriptor)
Get relation for given content, type and name.
|
int |
getRelationsCount(ContentEntityObject source,
ContentEntityObject target,
RelationDescriptor relationDescriptor)
Get total number of relations for given content, type and name.
|
List<ContentEntityObject> |
getSources(RelationQuery<ContentEntityObject> request,
int start,
int limit)
Fetch all related sources for the entity.
|
int |
getSourcesCount(RelationQuery<ContentEntityObject> request)
Count of all related sources for the entity.
|
List<ContentEntityObject> |
getTargets(RelationQuery<ContentEntityObject> request,
int start,
int limit)
Fetch all related targets for the entity.
|
int |
getTargetsCount(RelationQuery<ContentEntityObject> request)
Count of all related targets for the entity.
|
protected Content2ContentRelationEntity |
newRelationEntity(ContentEntityObject source,
ContentEntityObject target) |
int |
removeAllRelations(RelatableEntity relatableEntity)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelationsFromEntityWithName(String relationName,
RelatableEntity relatableEntity)
This method remove all relations with the given name, where the given entity participates
|
constructRelationEntity, createRelationEntity, getRelationEntities, removeRelationEntity
public Content2ContentHibernateRelationDao(org.hibernate.SessionFactory sessionFactory)
public int getRelationsCount(ContentEntityObject source, ContentEntityObject target, RelationDescriptor relationDescriptor)
RelationDao
relationDescriptor
- specifies relation metadata, such as type and nameRelationDescriptor
@Nullable public Content2ContentRelationEntity getRelationEntity(ContentEntityObject source, ContentEntityObject target, RelationDescriptor relationDescriptor)
RelationDao
relationDescriptor
- specifies relation metadata, such as type and nameRelationEntity
or null
if no relations found@Nonnull public List<ContentEntityObject> getSources(RelationQuery<ContentEntityObject> request, int start, int limit)
RelationDao
request
argumentRelatableEntity
RelationQuery
@Nonnull public List<ContentEntityObject> getTargets(RelationQuery<ContentEntityObject> request, int start, int limit)
RelationDao
request
argumentRelatableEntity
RelationQuery
public int getSourcesCount(RelationQuery<ContentEntityObject> request)
RelationDao
request
argumentpublic int getTargetsCount(RelationQuery<ContentEntityObject> request)
RelationDao
request
argumentpublic int removeAllRelations(RelatableEntity relatableEntity)
RelationDao
public int removeAllRelationsFromEntityWithName(String relationName, RelatableEntity relatableEntity)
RelationDao
public int removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
RelationDao
public List<Long> getAllRelationIdsForContentInSpace(@Nonnull String spaceKey, @Nonnull Collection<ConfluenceEntityObject> exclusions, int start, int limit)
spaceKey
- spaceexclusions
- list of exclusionsstart
- startlimit
- limitprotected Content2ContentRelationEntity newRelationEntity(ContentEntityObject source, ContentEntityObject target)
newRelationEntity
in class HibernateRelationDao<ContentEntityObject,ContentEntityObject>
Copyright © 2003–2018 Atlassian. All rights reserved.