My english is not good ;-)
What I want is in C object 2 collections one with typeA Object and one with
typeB Object. My question is how to do a mapping with OJB that can make this
kind of switch on type field.
In other word when I load A objects collection of a C object the query is :
SELECT AFields ... FROM A, C WHERE C.id=? AND C.foreignId = A.idA AND
C.type="typeA"
And for B objects collection :
SELECT BFields ... FROM B, C WHERE C.id=? AND C.foreignId = B.idB AND
C.type="typeB".
regards,
Florent
ps :
the relation to map was :
Table A
idA
otherFields
Table B
idB
otherFields
Table C
idC
foreignId
type
otherFields
Relation : C - A 1:n
C - B 1:n
example :
A
a1 ...
a2 ...
B
b1 ...
b2 ...
C
c1 b1 typeB ...
c2 a1 typeA ...
c3 b2 typeB ...
Surlignage [EMAIL PROTECTED]:
>
>
>
>
>
> Hello Florent,
>
> I understand this as a question about the typeB collection or the typeA
> collection exclusively in the C instance?
> Then you can't even model this in UML (or so I think), so I don't think you
> can in OJB.
>
> The only workaround I know without having two collections in C is a
> relation to the class Object (or another parent of A as well as parent of
> B), but actually I have huge problems with OJB in determining which is the
> real child class with a relation to the parent class.
>
> What is so bad about having two collections in C anyway? In the setter
> method you cold restrict on having only one collection filled.
>
> regards,
> Birgitta
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]