lundi 20 avril 2015

Creating a tree template in SQL

I am working with a database used to store information about entities in the form of a tree of components. For example, it might have a camry object with children air-conditioner and engine. The engine might have pistons as children, and air-con have vents as children.

The idea is that the user would custom-create something like this as a 'template' which would then be used to instantiate the camry 'tree' as needed. So the user might first create the template, and then use it to add ten of those camry trees to a workshop, storing unique data against each by selecting 'add new car', selecting camry, and then picking a name.

How would you store such a construction in a database, and is there any easy way to instantiate a tree like that?

Aucun commentaire:

Enregistrer un commentaire