Implementing an ordered tree

Karoly Szantai <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hello,

I have a Category entity. Each Category has zero or more subcategories, 
which are ordered. There is a root Category (called main category) 
which has no parent.
I have created this EO model:

oid
oidParentCategory
name
ordinalNumber

parentCategory (oidParentCategory --> oid)
subcategories (oid -->> oidParentCategory)


I need some hints on how to implement the following operations 
(methods) with "ordered way":

-add a category
-delete a category
-cut & paste a category (and its subcategories) from one level to 
another level
-reorder categories (move a category in its level)
etc.

My big headache is manipulating the ordinalNumber attribute in "EO way".


Regards,
Karoly
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.