Class DefaultAncestorsDao

java.lang.Object
com.atlassian.confluence.pages.ancestors.DefaultAncestorsDao
All Implemented Interfaces:
AncestorsDao

@Internal public class DefaultAncestorsDao extends Object implements AncestorsDao
JDBC methods for operations with CONFANCESTORS table
Since:
9.3
  • Constructor Details

    • DefaultAncestorsDao

      public DefaultAncestorsDao(org.hibernate.SessionFactory sessionFactory, com.atlassian.event.api.EventPublisher eventPublisher)
  • Method Details

    • getAllChildrenFromDB

      @Transactional(readOnly=true) public Map<Long,List<Long>> getAllChildrenFromDB(@NonNull List<Long> pageIdList)
      Returns map with children, where keys are passed page ids and values are list of corresponding children
      Specified by:
      getAllChildrenFromDB in interface AncestorsDao
      Parameters:
      pageIdList - - list of pages
      Returns:
    • getAncestorsFromConfancestorsTable

      @Transactional(readOnly=true) public Map<Long,List<Long>> getAncestorsFromConfancestorsTable(@NonNull List<Long> pageIdList)
      getAncestorsFromConfancestorsTable reads ancestors from confancestors table in batches It receives a list of page ids and returns a map where keys are page ids and values are lists of ancestors Just for better performance
      Specified by:
      getAncestorsFromConfancestorsTable in interface AncestorsDao
    • getTopLevelPages

      @Transactional(readOnly=true) public List<Long> getTopLevelPages(@NonNull Long spaceId)
      getTopLevelPages returns a list of top-level pages in the space top-level means that the page does not have a parent
      Specified by:
      getTopLevelPages in interface AncestorsDao
    • deleteAllAncestors

      @Transactional(propagation=REQUIRES_NEW) public void deleteAllAncestors(@NonNull Long pageId)
      Deletes all ancestors for the particular page
      Specified by:
      deleteAllAncestors in interface AncestorsDao
    • addsAncestor

      @Transactional(propagation=REQUIRES_NEW) public void addsAncestor(@NonNull Long pageId, @NonNull Long ancestorId, @org.checkerframework.checker.nullness.qual.NonNull int position)
      Adds one record to CONFANCESTORS table
      Specified by:
      addsAncestor in interface AncestorsDao
    • fixAncestorsForOnePage

      @Transactional(propagation=REQUIRES_NEW) public void fixAncestorsForOnePage(Long pageId, List<Long> ancestors)
      1. Deletes records from CONFANCESTORS page for one page 2. Inserts valid records to CONFANCESTORS for this page
      Specified by:
      fixAncestorsForOnePage in interface AncestorsDao
    • fixPages

      @Transactional(propagation=REQUIRES_NEW) public void fixPages(List<com.atlassian.confluence.pages.ancestors.PageWithAncestors> pagesToFix)
      fixes a bunch of pages in one transaction
      Specified by:
      fixPages in interface AncestorsDao