-->
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.  [ 4 posts ] 
Author Message
 Post subject: Ternary association: Why not collection in the map values ?
PostPosted: Wed Mar 17, 2004 5:26 am 
I have a map-based ternary association (let's say a table ABC linking tables A, B and C) and the following mapping:

Code:
<map name="myMap">
  <key column="id_A"/>
  <index-many-to-many column="id_B" class="..."/>
  <many-to-many column="id_C" class="..."/>
</map>


Calling:
instanceOfA.getMyMap().get(instanceOfB)
works fine...but I do not understand why it always returns a single object and not a collection (whose size possibly > 1) !

As in a ternary association the 3-uple (id_A, id_B, id_C) is the "semantic" primary key,
it seems obvious that there is possibly more than a single entry matching: (id_A, id_B, *):
instanceOfA.getMyMap().get(instanceOfB) => *
Therefore I would expect * as being a collection...Right ??

What could be a possible solution to handle collections at the C-side ?

Thanks in advance.


Top
  
 
 Post subject:
PostPosted: Mon Dec 22, 2008 3:52 pm 
Newbie

Joined: Mon Dec 22, 2008 3:49 pm
Posts: 2
Hi,

I have the same question. I can get a Map<<Object, Object>> but not a Map<<Object, Set>>.

Is the Map<<Object, Set>> possible in hibernate?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 19, 2009 4:19 pm 
Newbie

Joined: Sun Sep 07, 2008 11:07 pm
Posts: 17
Hi,
I am having the same probelm. Please give a solution ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 12, 2009 8:58 pm 
Newbie

Joined: Thu Feb 12, 2009 8:50 pm
Posts: 1
Hi.
I totally agree with you, if we are working with a ternary association there should be a set of values instead of a single value!!!! I think this is a terrible bug or mistake.
I'm having exactly the same problem. Please have anybodu solved this issue????
Please!


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

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.