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.
|
|