-->
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: ternary relationship
PostPosted: Tue Oct 21, 2003 9:48 am 
Newbie

Joined: Wed Sep 24, 2003 7:37 am
Posts: 6
Location: Bologna (ITALY)
I've the following problem.
I've three tables (name it A, B and C) each one with an unique identifier (ID column) and a ternary relationship table (name it ABC) with three fields ID_A, ID_B and ID_C.
I want to access this relationship through the objects mapped on the A table like the access of a map.
Let suppose that the content of the ABC table contain the following data:
ID_A:ID_B:ID_C
1:1:1
1:1:2
1:2:1
1:3:1
1:3:2
...

On the object A I want to put a map accessible by the object B (the index) in order to list ALL the C objects whose key is B.
For example if a1 is the object with ID = 1 what we want is to do something like this:

a1.getBs().get(b3)

in order to retrieve a collection of element containing the c1 and c2 objects.

This kind of mapping is requested in order to have to write something like this in HQL:

select elements(a.bs[b3]) from a

I hope that all it's clear.

Thank in advance for the responses.

Mauro.


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.