public class Content2ContentHibernateRelationDao extends HibernateRelationDao<ContentEntityObject,ContentEntityObject>
BATCHING_CHUNK_SIZE, 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(@NonNull String spaceKey,
@NonNull Collection<ConfluenceEntityObject> exclusions,
int start,
int limit)
This method returns ids of all content relation entities in space.
|
@Nullable 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.
|
@NonNull 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.
|
@NonNull 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(Iterable<? extends RelatableEntity> relatableEntities)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelations(RelatableEntity relatableEntity)
This method removes all relations (across all names and types), where given entity participates.
|
int |
removeAllRelationsFromCurrentAndHistoricalEntities(Iterable<? extends RelatableEntity> relatableEntities)
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
public @Nullable Content2ContentRelationEntity getRelationEntity(ContentEntityObject source, ContentEntityObject target, RelationDescriptor<?,?> relationDescriptor)
RelationDao
relationDescriptor
- specifies relation metadata, such as type and nameRelationEntity
or null
if no relations foundpublic @NonNull List<ContentEntityObject> getSources(RelationQuery<ContentEntityObject> request, int start, int limit)
RelationDao
request
argumentRelatableEntity
RelationQuery
public @NonNull 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 removeAllRelations(Iterable<? extends RelatableEntity> relatableEntities)
RelationDao
public int removeAllRelationsFromEntityWithName(String relationName, RelatableEntity relatableEntity)
RelationDao
public int removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
RelationDao
public int removeAllRelationsFromCurrentAndHistoricalEntities(Iterable<? extends RelatableEntity> relatableEntities)
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–2020 Atlassian. All rights reserved.