ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Mapping 3 way join tables
Date Fri, 30 Sep 2005 16:22:24 GMT
Can you clarify the cardinality of the relationships between the A,B,C data
model, and also clarify the exact object graph you want to map it to?

I'm sure there's a way to derive it from the information you've provided,
but it's easier to just ask.

Clinton


On 9/29/05, reubenf@sonic.net <reubenf@sonic.net> wrote:
>
> Hello,
>
> I have tables A, B and C, which are related via table A_B_C:
>
> A:
> a_id
>
> B:
> b_id
>
> C:
> c_id
>
> A_B_C:
> a_id
> b_id
> c_id
>
> I have beans representing A, B & C, but I would like to avoid having a
> bean representing A_B_C. That is, A (the owner) would ideally have
> instances of B & C, ideally mapped in a hashmap as follows:
>
> {B -> C[]}
>
> How can I express this with resultMaps? Is it possible? It would seem to
> imply that I need a setter method:
>
> A#setBCRelationship(B b, C c)
>
> ...but this does not seem permissible with Ibatis. Anybody have a
> workaround?
>
> Thanks
> Reuben
>
>
>
>
>

Mime
View raw message