Class AncestorsDao

  • @Internal
    public class AncestorsDao
    extends Object
    JDBC methods for operations with CONFANCESTORS table
    • Constructor Detail

      • AncestorsDao

        public AncestorsDao​(org.hibernate.SessionFactory sessionFactory,
                            com.atlassian.event.api.EventPublisher eventPublisher)
    • Method Detail

      • getAllChildrenFromDB

        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
        pageIdList - - list of pages
      • getAncestorsFromConfancestorsTable

        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
      • getTopLevelPages

        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
      • deleteAllAncestors

        public void deleteAllAncestors​(@NonNull Long pageId)
        Deletes all ancestors for the particular page
      • addsAncestor

        public void addsAncestor​(@NonNull Long pageId,
                                 @NonNull Long ancestorId,
                                 @org.checkerframework.checker.nullness.qual.NonNull int position)
        Adds one record to CONFANCESTORS table
      • fixAncestorsForOnePage

        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
      • fixPages

        public void fixPages​(List<com.atlassian.confluence.pages.ancestors.PageWithAncestors> pagesToFix)
        fixes a bunch of pages in one transaction