Hi,

I'm fairly new to dom4j so I wanted to ask the great dom4j community to give
me some pointers, thoughts or design patterns how to map an existing
in-memory tree (e.g. dom4j) to RDBMS.

Mostly all nodes in that tree are instantiated with the same class
("Element") and could be distinguished by an attribute typ. Every node has a
list of its children. Futhermore, these node types have to be stored in
different db-tables.

Example: A car consists of severel parts (tires, seats, doors .. ) and is
represented as a XML-file.

<cars>
<car name="car1">
<tires>
<tyre> One </tyre>
<tyre> Two </tyre>
<tyre> Three </tyre>
<tyre> Four </tyre>
</tires>
<seats>
...
</seats>
...
</car>
...
</cars>

So, I've parsed the XML file and generated a dom4j tree.

But how do I create a mapping for this in-memory tree with different
db-tables (Car, Tyre, Seat..) and read it again out of it in the same
structure where all nodes are of the same "Element"?

Or is it easier to subclass the "Element"-class and create required real
classes like "Car", "Tyre", "Seat".. and create a mapping with them? But how
do I reconstruct the tree-structure with that?

Thank you all and kind reagards!

-- 
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl
GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis!


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to