Class DefaultAncestorsDao
java.lang.Object
com.atlassian.confluence.pages.ancestors.DefaultAncestorsDao
- All Implemented Interfaces:
AncestorsDao
JDBC methods for operations with CONFANCESTORS table
- Since:
- 9.3
-
Field Summary
Fields inherited from interface com.atlassian.confluence.pages.ancestors.AncestorsDao
IN_CLAUSE_LIMIT
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAncestorsDao
(org.hibernate.SessionFactory sessionFactory, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addsAncestor
(@NonNull Long pageId, @NonNull Long ancestorId, @org.checkerframework.checker.nullness.qual.NonNull int position) Adds one record to CONFANCESTORS tablevoid
deleteAllAncestors
(@NonNull Long pageId) Deletes all ancestors for the particular pagevoid
fixAncestorsForOnePage
(Long pageId, List<Long> ancestors) 1.void
fixes a bunch of pages in one transactiongetAllChildrenFromDB
(@NonNull List<Long> pageIdList) Returns map with children, where keys are passed page ids and values are list of corresponding childrengetAncestorsFromConfancestorsTable
(@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 performancegetTopLevelPages
(@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
-
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 interfaceAncestorsDao
- 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 interfaceAncestorsDao
-
getTopLevelPages
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 interfaceAncestorsDao
-
deleteAllAncestors
Deletes all ancestors for the particular page- Specified by:
deleteAllAncestors
in interfaceAncestorsDao
-
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 interfaceAncestorsDao
-
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 interfaceAncestorsDao
-
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 interfaceAncestorsDao
-