Friday, May 23, 2008 Managing Hierarchical Data
With Core Data, you can store data in relational model. However, handling hierarchical data (directory tree and other tree structure) in relational database can be painful.
The most straight-forward method is to create a “parent ID” column. You recursively query the database to find a node. Or, you can have to create lengthy “self-join” statement to get the path to a node. This is surely not an ideal solution.
MySQL developer site has an article about creating a nested set model which simplifies SQL statements a lot. Check the article and see if it works for you.
Commenting is closed for this article.