Save and query dependent objects

Carsten Karkola ckarkola at web.de
Thu Nov 22 20:03:00 UTC 2007


Hi,

I'm new to magma and I've read the docs in the swiki and browsed the magma tests to get a basic understanding how to work with it. In the FAQs I found an answer: "With the standard dependency mechanism, dependents are not directly connected, so they will not be persisted". What does this mean? Lets say I have some classes:

Building
Floor
Room

A Buidling has floors and floors have rooms. As far as I understand - if I save a building instance in magma, the assoicated floors and there rooms will also be saved. So I can get a building instance from magma and ask it  for its children. But how do I look for a specific room in magma without traversing the whole tree structure starting at the building node. In a RDBMS I would query for the room - get the foreign key of the floor and so on.

Or should I put all tree nodes (building, floor and room instances) in there own MagmaCollection to use them with a MagmaCollectionReader? What would be the best way to save such a tree like structure with the ability to query for one of the nodes and to get after that the parents of that node? The goal is not only to traverse the tree from top but also to answer questions like "What room has the user carsten and in which building can I find this room?".

Thanks, Carsten

_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220



More information about the Magma mailing list