If each A can have several Bs, I have no problem defining a one-to-many map that gives me the map of Bs, in A's hbm.xml.
However, I can't figure out, if I _only_ have a table of Bs, how to define a map in B's hbm.xm, of all the B'sl. That is, I want a way to fetch a map of _all_ B's, without having to define a dummy A that has all B's.
In the simplest case, if I have a table:
col1 col2
+----+-----+
| foo | bar |
+----+-----+
| baz | qux |
+----+-----+
How can I get a map such that:
Key (String) -> Object (String)
foo bar
baz qux
_without_ having _another_ table which has a one to many relationship with this table?
Is this too simple for Hibernate?
I have thrashed on it for a while without figuring out how to do it...
I really just want a PersistentMap interface to a single table...
-Tom
|