I have a database structure that models a forest of trees in a single table.
This is achieved by the table having 3 fields, the primary key, the primary key of its parent item (pointing to the same table), and a field to identify which tree in the forest this node belongs to.
Due to performance issues, I am not referencing the 'parent' or 'child' elements as 'classes', but just as strings of the promary keys.
So the children collection would be a collection of PK strings, rather than the class objects themselves.
My issue is that the only way I can model this in a class is to have a Map of Sets of strings.
This would work perfectly, if I had tree1, tree2, and tree3, then
myobject.children['tree1'] woud be a Set of strings identifying the PKs of each child element.
Any idea how I would model this in an HBM?
I dont think its possible to place a <set> inside of a <map>...
Any ideas?
Thanks in advance.
- Adam Langley
|