So, more in practise:

Classes:

Class A {                                               Classe QualifiedARef {
int A_id                                                int qualifiedId
String name                                             A classARef
QualifiedARef qualifiedARef                     String relationInfo     
...                                                     int A_id
}                                                       ....
                                                        }


Relationnal tables:

A                                               QualifiedARef
-                                               -------------
int A_id_PK                                     int qualifiedARef_PK
String name                                     int A_id_class_ref_FK
                                                String relationInfo
                                                int A_id_FK


Am I on the right way?
is there a probem in the QualifiedARef table because there are 2 FK for A??

Thank you
Regards
Sylvain




-----Message d'origine-----
De: Phil Warrick [mailto:[EMAIL PROTECTED]]
Date: lundi, 16. d�cembre 2002 15:59
�: OJB Users List
Objet: Re: OJB and recursive relationship


Hi Sylvain,

Yes, then class A instead has a reference to a class QualifiedARef (or a 
collection of these).  QualifiedARef holds the relation info and a 
reference to the target A.  If bidirectionality is important, it can 
hold a reference to both of the As in the relation.

Phil

[EMAIL PROTECTED] wrote:
> Hi Phil,
> 
> Thank you for your answer.
> Is it also possible if you qualified this self reference (add information about 
>relation)?
> 
> For example if class A have a reference to another instance of class A and this 
>reference has information like reference_name or something like that.
> 
> Regards
> Sylvain
> 
> -----Message d'origine-----
> De: Phil Warrick [mailto:[EMAIL PROTECTED]]
> Date: lundi, 16. d�cembre 2002 15:14
> �: OJB Users List
> Objet: Re: OJB and recursive relationship
> 
> 
> Hi Sylvain,
> 
> OJB handles self references fine.  In other words class A can have a 
> reference to another instance of class A or a collection of class As. 
> You may need to make these proxies if the graph is very large and you 
> need to control the hits to the db.
> 
> Phil
> 
> [EMAIL PROTECTED] wrote:
> 
>>Hello,
>>
>>I have a situation with recursive relationship:
>>
>>I have a class Software that represents the softwares that could be installed on my 
>machine. Some of these softwares must have other softwares installed before to be 
>able to be installed.
>>So, I have a recurvive relationship here.
>>
>>How do you implement this relationship with OJB?
>>
>>Thank you
>>Sylvain
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



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


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

Reply via email to