db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Göschl,Siegfried" <Siegfried.Goes...@drei.com>
Subject RE: URGENT!! Optinanal foreign key column not deleting
Date Mon, 05 Jul 2004 06:52:15 GMT
Hi Vjeran,

This problem rings a few bells but I'm hard-pressed to remember which one .. :-)

Basically I can't see what's wrong with your code buit there are a few problems with doDelete()
I'm aware of

+) Using multiple criteria might not work (seee "Problem using doDelete with multiple criteria
fields" )

+) Use a whole object for deletion is dangerous since all fields are used within the WHERE
clause and this includes BLOBs and timestamps

Therefore ...

+) Is it possible that you create a PK for the junction table?! Since your foreign keys could
be null you should/must use an artificial id - having said that I'm not sure why four fk's
are nullable.

+) You could P6Spy to have a look at the generated SQL statements


Cheers,

Siegfried Goeschl


-----Original Message-----
From: Vjeran Marcinko [mailto:vjeran@tis.hr] 
Sent: Sonntag, 04. Juli 2004 14:03
To: torque-user@db.apache.org
Subject: URGENT!! Optinanal foreign key column not deleting


Hi folks.

I have a junction table (no primary key) containing only optional (nullable) foreign keys.
And I use javaType="object" attribute in schema xml. Everything works fine except deleting.

Lets' say I want to select some rows :
Criteria crit = new Criteria();
        crit.add(TmModelProfilePeer.MODEL_ID, 95);
        List list = TmModelProfilePeer.doSelect(crit);

and eveything works fine. But when I want to delete these rows by same criteria :
        Criteria crit = new Criteria();
        crit.add(TmModelProfilePeer.MODEL_ID, 95);
        TmModelProfilePeer.doDelete(crit);
it doesn't work. No exception, just no deletion. ??!!
Help!!!

-Vjeran


*****************
Tis.kis d.o.o
Heinzelova 33
10000 Zagreb, CROATIA
URL: http://www.tiskis.com
Phone: +385 91 2392624


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