db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Ebeling <t.ebel...@conis.de>
Subject Re: doDelete question
Date Fri, 27 Feb 2004 08:57:44 GMT
Scott Eade wrote:
> mohan@physics.gmu.edu wrote:
>> Hi All
>> I am trying to write an application that deletes a row from a base Table
>> called Person. the "id" column is the primaryKey for the "Person" table.
>> There are lots of tables in the db that reference the "id" from the
>> Person. Can i also delete all the references from the db if i say
>> doDelete(personObject);
>> Please let me know.
> Check the torque schema DTD - there is an onDelete attribute to 
> foreign-key elements that you could set to cascade.  I can't guarantee 
> that this has been implemented or that it works with all databases - you 
> will need to try it out.
> Scott


I'm using the tdk with turbine 2.3, (I guess) Torque 3.0 and mysql 4x. 
It didn't work by default with just onDelete="CASCADE". To use this 
database function, you have to use InnoDB with mysql. For this, it seems 
that you have to run through your database and chance the ISAM-Tables 
with ALTER to InnoDB, since I haven't found any option in the DTD to 
define the type of table. But even this didn't make the ON DELETE appear 
in the references. I'm also still searching for a solution or best 

An idea of mine was to put a function into every object class named 
"deleteCascade", which calls the generated function 
get<ObjectsReferencingThis>s(), calls for each object of the resulting 
list "deleteCascade()", and finally deletes the current object.

Like with Scott's "Persons", some of these functions might become huge, 
especially since some Exceptions needed to be caught...

Feel free to critisize my idea and suggest better ones. :)

Ah, and sorry for my bad English. I'm not posting on English mailing 
lists very often. :)


Thomas Ebeling
Software Engineer
conis Informationssysteme GmbH
Hohenzollerndamm 196
10717 Berlin
Tel.: +49 (0) 30 / 86 31 34 00
Fax: +49 (0) 30 / 86 31 34 02
Mobile: +49 (0) 151 / 15 10 56 67
email: t.ebeling@conis.de
Internet: www.conis.de

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

View raw message