db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <new...@pingsite.com>
Subject Can't delete row, either no delete or get "You must specify KeyDef..." exception.
Date Tue, 08 Mar 2005 23:48:01 GMT

I'm at my wit's end.

I'm trying to delete a record from a table that has three foreign keys 
(schema fragment attached) and it seems no matter how I try to do it I 
either get the "You must specify KeyDef attributes for this TableDataSet 
in order to delete a Record" exception. It's a MySQL db, using Torque 3.1.


  <table name='user_role' description='Map of users to user roles and 
    <column name='role_name' size='32' type='VARCHAR' description='FKEY 
role_name' required='true' primaryKey="true"/>
    <column name='user_id' type='INTEGER' description='FKEY User ID' 
required='true' primaryKey="true"/>
    <column name='event_id' type='INTEGER' description='FKEY Event ID' 
required='true' primaryKey="true"/>
    <foreign-key foreignTable='event'>
      <reference local='event_id' foreign='event_id'/>
    <foreign-key foreignTable='role'>
      <reference local='role_name' foreign='role_name'/>
    <foreign-key foreignTable='user'>
      <reference local='user_id' foreign='user_id'/>

Whether I have the 'primaryKey' attributes in there or not it doesn't 
work using doDelete with Criteria or a matching object.

So I build the SQL myself and do an executeStatement, which fails 
silently, deleting nothing. I cut and paste the query into a MySQL query 
browser and it works fine, naturally.

Where am I going wrong? I searched the archives and found this question 
but no answer, including the following not-so-helpful wiki entry: 
http://wiki.apache.org/db-torque/TorqueProjectPages/FAQ down at the bottom.

Hep me! Hep me! I've been using torque for years (no, really!) and never 
had this issue before whether by accident or design.


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

View raw message