hi glenn,
thx for your reply.

foreign keys are well generated, objects creation works well.
my mapping is also almost like this one u show.. *but* my relation is 
_inverted_ : since i have a B collection in C, ive declared my mappping like 
this :

<class name="B>
<field name="b" type="B">
      <sql name="b_id" />
</field>
</class>

<class name="C">
<field name="c" type="B" required="false" collection="vector">
      <sql many-key="b_id"/>
</field>
</class>

is this wrong?
another question : ive read that castor doesnot support uni-directionnal 
relationships, is this right? in fact my C object here represents a 
CommandLine and my B object represents a Product, so i dont want C to be 
navigable from B.. how can i achieve this? (cos if i dont declare a C 
collection in B castor complains [need setter/getter methods])

--
gilles dodinet



>From: "Russell, Glenn" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: [castor-dev] Re: [castor-dev]
>Date: Mon, 30 Jul 2001 17:11:49 +0100
>
>Hey,
>
>Are u using a bi-directional relationship between B and C?
>
>If so, is your foreign key value being populated?
>
>If not, ensure the 'many-key' in B is the same column as the reference 
>field
>in C,
>
>e.g
><class name="C" ... >
>    <field name="b" type="B">
>       <sql name="c_id" />
>    </field>
></class>
>
><class name="B" ... >
>    <field name="C" type="C" collection="..">
>       <sql name="c_id" />
>    </field>
></class>
>
>Glenn.
>
>
>-----Original Message-----
>From: gilles dodinet [mailto:[EMAIL PROTECTED]]
>Sent: 30 July 2001 17:03
>To: [EMAIL PROTECTED]
>Subject: [castor-dev]
>
>
>i have an object A, an object B and an object C dependent on A. theres also
>a one-to-many relationship B->C (non-dependent rel.)
>
>+-----+ 1         * +-----+ *     1 +-----+
>|  A  |<>-(dep)-----|  C  |<>-------|  B  |
>+-----+             +-----+         +-----+
>
>I have a problem to retrieve the A objects (oql = "select a from A a") :
>it seems that the B object contained by C is not lo�aded from the db (null
>value) when C object is retrieved (implicitly when loading A)
>=> is that a known problem or am i doing wrong?
>
>--
>gilles dodinet
>
>
>
>
>_________________________________________________________________
>T�l�chargez MSN Explorer gratuitement � l'adresse
>http://explorer.msn.fr/intl.asp
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
>


_________________________________________________________________
T�l�chargez MSN Explorer gratuitement � l'adresse 
http://explorer.msn.fr/intl.asp

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to