-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Is a map for only 1 table too simple? Is is possible?
PostPosted: Wed Sep 14, 2005 6:41 pm 
Newbie

Joined: Wed Sep 14, 2005 6:29 pm
Posts: 4
Location: USA
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.