Hola,
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.
Fragment:
<table name='user_role' description='Map of users to user roles and events'>
<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>
<foreign-key foreignTable='role'>
<reference local='role_name' foreign='role_name'/>
</foreign-key>
<foreign-key foreignTable='user'>
<reference local='user_id' foreign='user_id'/>
</foreign-key>
</table>
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.
Thanks, Dave
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]