User's Manual

Chapter 11. Services Tutorials 129
Figure 11-5. Category hierarchy before and after deleting a category
You can delete a category in the following ways:
Deleting Leaf Category — If the category is a leaf, call Category.delete().
Remapping Child Categories If you want to remove the current category and make all
categories that were pointing to it point to its default parent (as in the example), call
Category.deleteCategoryAndRemap().
Orphaning Children If you want to delete the category without remapping any of the child
categories, call Category.deleteCategoryAndOrphan(). Note that there is no way to navigate
from the root to orphaned categories. Effectively, the orphaned categories are no longer part of the
categorization schemes, unless they have non-default parents.
Deleting Category Subtree If you want to delete the entire subtree, including the passed-in
category and all categories below it whose default ancestry can be traced to the root, call Cate-
gory.deleteCategorySubtree().
11.2.3. Adding more Parent Categories
Category a = new Category(new OID(123));