db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kostyantyn Shchekotykhin <kos...@ifit.uni-klu.ac.at>
Subject Re: torque delete
Date Thu, 25 Mar 2004 08:46:05 GMT
Hi Guo,
can you send a piece of code where you make a delete that fails?

Regards,
Kostya

Göschl,Siegfried wrote:

> Hi Guo,
> 
> I'm not sure if the '*' in your XML schema should be there but you have two options to
delete. Either using the primary key and or the whole object. Both options should work for
you .
> 
> Cheers,
> 
> Siegfried Goeschl
> 
> -----Original Message-----
> From: Sheng Guo [mailto:sheng@in.tum.de]
> Sent: Wednesday, March 24, 2004 9:03 PM
> To: Apache Torque Users List
> Subject: Re: torque delete
> 
> 
> Hi,
> 
> This try failed,  I got the same error message:
> 
> org.apache.torque.TorqueException: You must specify KeyDef attributes 
> for this TableDataSet in order to delete a Record.
> 
> I added the code, which is bold, in the XML-Schema file:
> 
> <table name="sys_contact_category2sys_contact" 
> javaName="SYSContactCategory2SYSContact">
>         <column name="sys_contact_id" *primaryKey="true" 
> *required="true" type="BIGINT"/>
>         <column name="sys_contact_category_id"* primaryKey="true"* 
> required="true" type="INTEGER"/>
>         <foreign-key foreignTable="sys_contact">
>             <reference foreign="id" local="sys_contact_id"/>
>         </foreign-key>
>         <foreign-key foreignTable="sys_contact_category">
>             <reference foreign="id" local="sys_contact_category_id"/>
>         </foreign-key>
>     </table>
> 
> The peer classes were successfully created, but the problem was not 
> solved. Did I do anything wrong with the XML-Schema?
> 
> Thanks
> 
> Guo
> 
> 
> 
> Sheng Guo wrote:
> 
> 
>>Hi,
>>
>>Thanks for this advice, actually the relation table doesn't have any 
>>primary keys, it has only two foreign keys from the other two tables. 
>>Now I am trying to fix the XML-Schema, so that the foreign keys in the 
>>relation table are also primary keys. I don't know, if it will work, 
>>but I'll try it, and let you know.
>>
>>Thanks a lot
>>
>>Guo
>>
>>Kostyantyn Shchekotykhin wrote:
>>
>>
>>>Hi Sheng,
>>>KeyDef means primary key. It says to you that the primary key of the 
>>>table was not found and Torque is unable to identify records to 
>>>delete. If you'll poste some details, i'll try to help you more.
>>>
>>>Regards,
>>>Kostya
>>>
>>>Sheng Guo wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I am a new user of Torque, and I tried to delete some records from a 
>>>>relation table ( which holds the n:m relation of the other two 
>>>>tables), but it failed,
>>>>
>>>>the exception said:
>>>>
>>>>org.apache.torque.TorqueException: You must specify KeyDef 
>>>>attributes for this TableDataSet in order to delete a Record.
>>>>
>>>>what does it mean, and how can I specify KeyDef attributes?
>>>>
>>>>Thanks
>>>>
>>>>Guo
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>>>For additional commands, e-mail: torque-user-help@db.apache.org
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: torque-user-help@db.apache.org
>>>
>>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: torque-user-help@db.apache.org
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message