tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nikola Milutinovic <Nikola.Milutino...@ev.co.yu>
Subject Re: Concept for modeling hierarchical data
Date Tue, 10 Jan 2006 06:51:20 GMT
Florian Lindner wrote:

>Hello,
>I'm searching for the best concept of how to use and save hierarchical data.
>I have a structure like PC file system with meta data. There a folder objects 
>and files objects of different types. Every object have data like 
>permissions, date and author. And they have type-specific data fields like 
>resolution (of an image type) or location (of an meeting type) or ingredients 
>(of an recipe type).
>What is the best way to store that kind of data? What database is 
>recommendable? What concepts of persistance? Or not using managed persistance 
>and do it manually?
>  
>

If you want to do it manually, a hierarchical tree can be represented by 
just one table:

CREATE TABLE tree (
    id   INTEGER   PRIMARY KEY,
    parent_id   INTEGER
);

With managed persistence, be carefull not to configure it to load the 
entire tree at once.

As for a DB, any decent relational DB will do.

Nix.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message