Class User2UserHibernateRelationDao

java.lang.Object
com.atlassian.confluence.internal.relations.dao.hibernate.HibernateRelationDao<ConfluenceUser,ConfluenceUser>
com.atlassian.confluence.internal.relations.dao.hibernate.User2UserHibernateRelationDao
All Implemented Interfaces:
RelationDao<ConfluenceUser,ConfluenceUser>

public class User2UserHibernateRelationDao extends HibernateRelationDao<ConfluenceUser,ConfluenceUser>
Since:
5.9
  • Constructor Details

    • User2UserHibernateRelationDao

      public User2UserHibernateRelationDao(org.hibernate.SessionFactory sessionFactory)
  • Method Details

    • getRelationsCount

      public int getRelationsCount(ConfluenceUser source, ConfluenceUser target, RelationDescriptor<?,?> relationDescriptor)
      Description copied from interface: RelationDao
      Get total number of relations for given content, type and name.
      relationDescriptor - specifies relation metadata, such as type and name
      Returns:
      total number of relations for given entities, relation type and name.
      See Also:
    • getRelationEntity

      public @Nullable User2UserRelationEntity getRelationEntity(ConfluenceUser source, ConfluenceUser target, RelationDescriptor<?,?> relationDescriptor)
      Description copied from interface: RelationDao
      Get relation for given content, type and name.
      relationDescriptor - specifies relation metadata, such as type and name
      Returns:
      RelationEntity or null if no relations found
    • getSources

      public @NonNull List<ConfluenceUser> getSources(RelationQuery<ConfluenceUser> request, int start, int limit)
      Description copied from interface: RelationDao
      Fetch all related sources for the entity. Fetching parameters (relation name, filtering etc.) is provided by request argument
      Returns:
      list of RelatableEntity
      See Also:
    • getTargets

      public @NonNull List<ConfluenceUser> getTargets(RelationQuery<ConfluenceUser> request, int start, int limit)
      Description copied from interface: RelationDao
      Fetch all related targets for the entity. Fetching parameters (relation name, filtering etc.) is provided by request argument
      Returns:
      list of RelatableEntity
      See Also:
    • getSourcesCount

      public int getSourcesCount(RelationQuery<ConfluenceUser> request)
      Description copied from interface: RelationDao
      Count of all related sources for the entity. Fetching parameters (relation name, filtering etc.) is provided by request argument
      Returns:
      total number of all sources
    • getTargetsCount

      public int getTargetsCount(RelationQuery<ConfluenceUser> request)
      Description copied from interface: RelationDao
      Count of all related targets for the entity. Fetching parameters (relation name, filtering etc.) is provided by request argument
      Returns:
      total number of all targets
    • removeAllRelations

      public int removeAllRelations(RelatableEntity relatableEntity)
      Description copied from interface: RelationDao
      This method removes all relations (across all names and types), where given entity participates.
      Returns:
      number of relations which were removed.
    • removeAllRelations

      public int removeAllRelations(Iterable<? extends RelatableEntity> relatableEntities)
      Description copied from interface: RelationDao
      This method removes all relations (across all names and types), where given entity participates.
      Returns:
      number of relations which were removed.
    • removeAllRelationsFromEntityWithName

      public int removeAllRelationsFromEntityWithName(String relationName, RelatableEntity relatableEntity)
      Description copied from interface: RelationDao
      This method remove all relations with the given name, where the given entity participates
      Returns:
      number of relations which were removed
    • removeAllRelationsFromCurrentAndHistoricalEntities

      public int removeAllRelationsFromCurrentAndHistoricalEntities(RelatableEntity relatableEntity)
      Description copied from interface: RelationDao
      This method removes all relations (across all names and types), where given entity participates. It also removes all relations from the historical versions of the given entity if the entity is the most current version of content
      Returns:
      number of relations which were removed.
    • removeAllRelationsFromCurrentAndHistoricalEntities

      public int removeAllRelationsFromCurrentAndHistoricalEntities(Iterable<? extends RelatableEntity> relatableEntities)
      Description copied from interface: RelationDao
      This method removes all relations (across all names and types), where given entity participates. It also removes all relations from the historical versions of the given entity if the entity is the most current version of content
      Returns:
      number of relations which were removed
    • newRelationEntity

      protected User2UserRelationEntity newRelationEntity(ConfluenceUser source, ConfluenceUser target)
      Specified by:
      newRelationEntity in class HibernateRelationDao<ConfluenceUser,ConfluenceUser>