> -----Message d'origine-----
> De : Gelhar, Wallace J. [mailto:[EMAIL PROTECTED]] 
> Envoy� : jeudi 6 f�vrier 2003 15:37
> � : OJB Users List
> Objet : RE: Collection need back reference (2)
> 
> 
> >>I don't understand why it's necessary.
> >>I'm afraid we put relational concept in object model.
> >
> >>Say A is compose of many B.
> 
> >And what about if C is compose of many B too and D is also compose B
> too. Does it mean that I need to add another extra attributes 
> (in this case three) to B class? 
> >Is there any workaround?
> 
> So what your saying is that in your database you have several 
> tables that have relationships to one table.  This would 
> imply that the foreign key in your B table would be unique 
> across all primary key tables (A,C,D).  So the answer to your 
> question is no, you only need one attribute to represent your 
> foreign key in object B.
> 
> I agree that this is not exactly transparent persistence, but 
> as Thomas has pointed out, you do not need to expose the 
> attribute publicly to your BO clients.  According to Thomas, 

OK. How to design B java class to hide the foreign key ?
I supose a public accessor is needed by OJB ?
Do I have to maintain the foreing key in Java code ?
In the case I change instance of A, do I have to change the foreing key
in B
"by hand" or is it done by OJB ?

[SNIP]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to