Class ContentEntityObjectEraser
java.lang.Object
com.atlassian.confluence.impl.space.deletion.backgrounddeletion.erasers.ContentEntityObjectEraser
- All Implemented Interfaces:
EntityEraser
Deletes records from CONTENT table. This table has its own specific eraser for four reasons:
- CONTENT table keeps data for plenty of hibernate entities, pages, blog posts, comments, etc
- It contains a few different tree structures inside (parent - child, page - inner object, parent comment - child comment, etc). All those trees use their own columns for organising it.
- It also has to delete artificial objects in CONFANCESTORS table.
- It has to send events when pages are deleted.
Therefore, we have need a special eraser to do the work above properly.
- Since:
- 9.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionContentEntityObjectEraser
(BooleanSupplier isDeadlineReached, ConfluenceUser initiator, SpaceDeletionSqlScriptsRunner spaceDeletionSqlScriptsRunner, Collection<ExportableEntityInfo> exportableContentEntityInfos, Collection<TableFieldHavingForeignKey> dependantFieldsWithEntities, Map<Class<?>, EntityEraser> allErasers, AttachmentFileEraser attachmentFileEraser, AncestorsEraser ancestorsEraser, BucketPropertySetItemEraser bucketPropertySetItemEraser, SpaceDeletionEventSender spaceDeletionEventSender) -
Method Summary
Modifier and TypeMethodDescriptiondeleteDataRecursively
(String columnName, Collection<Long> ids) Deletes records in the table where ids in columnName are in ids list.Class<?>
Get the class name of the Hibernate entity, for example, Label.class, Space.class etc.
-
Constructor Details
-
ContentEntityObjectEraser
public ContentEntityObjectEraser(BooleanSupplier isDeadlineReached, ConfluenceUser initiator, SpaceDeletionSqlScriptsRunner spaceDeletionSqlScriptsRunner, Collection<ExportableEntityInfo> exportableContentEntityInfos, Collection<TableFieldHavingForeignKey> dependantFieldsWithEntities, Map<Class<?>, EntityEraser> allErasers, AttachmentFileEraser attachmentFileEraser, AncestorsEraser ancestorsEraser, BucketPropertySetItemEraser bucketPropertySetItemEraser, SpaceDeletionEventSender spaceDeletionEventSender)
-
-
Method Details
-
getEntityClass
Description copied from interface:EntityEraser
Get the class name of the Hibernate entity, for example, Label.class, Space.class etc. Pages, blogpost etc use just one class, ConfluenceEntityObject.- Specified by:
getEntityClass
in interfaceEntityEraser
- Returns:
- hibernate entity class.
-
deleteDataRecursively
Description copied from interface:EntityEraser
Deletes records in the table where ids in columnName are in ids list. Before this, it will call other erasers to remove their dependent data. For example, for space permissions, columnName will be SPACEID and ids will contain the list of space ids. In this case, this method will remove all space permissions where SPACEID in (ids)- Specified by:
deleteDataRecursively
in interfaceEntityEraser
- Parameters:
columnName
- column name (referencing to some other parent entity)ids
- ids for removal (parent ids actually)- Returns:
- deletion result (number of deleted objects and finished/not finished state)
-