Ender Hikmet KILICOGLU wrote:
> Yes Y exists
If Y exists, then make sure that you load Y in the transaction where
you call X.setY, otherwise Castor will not set the reference.

Oleg


>  
> I cant make Y depends X because It used by many other tables
> I will try setAutoStore
> Thanks 

> Ender

> -----Original Message-----
> From: Oleg Nitz [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, July 22, 2001 12:47 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [castor-dev] unable create record but it can be loaded


> Hi Ender,

> So X has a reference to Y and you create X, right?
> Does Y already exist in the database at this point? 
> You should either create Y first,
> or call setAutoStore(true) 
> or make Y "depends X".
> In the latter two cases Y will be created automatically.

> Oleg

> On Thursday 19 July 2001 14:01, Ender Hikmet KILICOGLU wrote:
>> Hi all
>> I have an object X with a field yID and Y object (with idendity yID)
>>
>> there is a relation many to one
>> In loading related one and related many loaded.
>> Bu when creating new one I use
>> public Y setY(Y y)
>> and I can read values using getY
>> on the db.create step I am receiving yID cannot be null for X object
>>
>>   <class name="a.X" identity="xid" key-generator="IDENTITY">
>>     <description>x</description>
>>     <map-to table="x"/>
>>     <field name="xid" type="integer">
>>       <sql name="xID " type="integer"/>
>>     </field>
>>     <field name="y" type="openisp.Y">
>>       <sql name="yID" required="true"/>
>>     </field>
>> </class>
>>
>> Thanks
>>
>> -----------------------------------------------------------
>> 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

> ----------------------------------------------------------- 
> 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

Reply via email to