public class User2UserHibernateRelationDao extends HibernateRelationDao<ConfluenceUser,ConfluenceUser>
BATCHING_CHUNK_SIZE, hibernate, RELATION_PARAM_NAME, sessionFactory, SOURCE_PARAM_NAME, TARGET_PARAM_NAME
Constructor and Description |
---|
User2UserHibernateRelationDao(org.hibernate.SessionFactory sessionFactory) |
Modifier and Type | Method and Description |
---|---|
@Nullable User2UserRelationEntity |
getRelationEntity(ConfluenceUser source,
ConfluenceUser target,
RelationDescriptor<?,?> relationDescriptor)
Get relation for given content, type and name.
|
int |
getRelationsCount(ConfluenceUser source,
ConfluenceUser target,
RelationDescriptor<?,?> relationDescriptor)
Get total number of relations for given content, type and name.
|
@NonNull List<ConfluenceUser> |
getSources(RelationQuery<ConfluenceUser> request,
int start,
int limit)
Fetch all related sources for the entity.
|
int |
getSourcesCount(RelationQuery<ConfluenceUser> request)
Count of all related sources for the entity.
|
@NonNull List<ConfluenceUser> |
getTargets(RelationQuery<ConfluenceUser> request,
int start,
int limit)
Fetch all related targets for the entity.
|
int |
getTargetsCount(RelationQuery<ConfluenceUser> request)
Count of all related targets for the entity.
|
protected User2UserRelationEntity |
newRelationEntity(ConfluenceUser source,
ConfluenceUser 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 User2UserHibernateRelationDao(org.hibernate.SessionFactory sessionFactory)
public int getRelationsCount(ConfluenceUser source, ConfluenceUser target, RelationDescriptor<?,?> relationDescriptor)
RelationDao
relationDescriptor
- specifies relation metadata, such as type and nameRelationDescriptor
public @Nullable User2UserRelationEntity getRelationEntity(ConfluenceUser source, ConfluenceUser target, RelationDescriptor<?,?> relationDescriptor)
RelationDao
relationDescriptor
- specifies relation metadata, such as type and nameRelationEntity
or null
if no relations foundpublic @NonNull List<ConfluenceUser> getSources(RelationQuery<ConfluenceUser> request, int start, int limit)
RelationDao
request
argumentRelatableEntity
RelationQuery
public @NonNull List<ConfluenceUser> getTargets(RelationQuery<ConfluenceUser> request, int start, int limit)
RelationDao
request
argumentRelatableEntity
RelationQuery
public int getSourcesCount(RelationQuery<ConfluenceUser> request)
RelationDao
request
argumentpublic int getTargetsCount(RelationQuery<ConfluenceUser> 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
protected User2UserRelationEntity newRelationEntity(ConfluenceUser source, ConfluenceUser target)
newRelationEntity
in class HibernateRelationDao<ConfluenceUser,ConfluenceUser>
Copyright © 2003–2019 Atlassian. All rights reserved.