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 unidirectional Map possible?
PostPosted: Tue Feb 12, 2008 7:34 pm 
Newbie

Joined: Tue May 01, 2007 11:15 am
Posts: 3
Hi,

I am using Hibernate 3.1.3 with Hibernate Annotations 3.1-beta8 and don't seem to have an option to upgrade now.

What I am trying to model is a

Code:
class C {
java.util.Map<Foo, Bar> map;
}

where neither Foo not Bar have a reference back to C or to each other. Is that possible somehow?
I mean, wouldn't that just require a table {id, map_id, foo_id, Bar_id} to map that to the database?
All examples I have found need Foo as an attribute in Bar (@MapKey(name="foo")) and a reference to C in Bar (@OneToMany(mappedBy="c")).
The worst thing about this, it seems that the reference to C in Bar must be a unique key or at least non null.

It would be very nice if somebody could help me with this issue.

Thanks in advance,
Philipp


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.