db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Daniel <markus.dan...@synyx.de>
Subject criteria.setCascade(true)
Date Sun, 17 Dec 2006 22:51:35 GMT
Hello,
just for understanding right...

If cascade is set to true in a criteria (not in the DB-Schema) this will only proceed
like cascade if the FK from relation table is also a PK for the relation table?

Snip from BasePeer#doDelete(Criteria criteria, Connection con)
...
// Only delete rows where the foreign key is
// also a primary key.  Other rows need
// updating, but that is not implemented.
if (columnMaps[j].isForeignKey()
    && columnMaps[j].isPrimaryKey()
    && key.equals(columnMaps[j].getRelatedName()))
...

Here a FK in a relation table is a PK in a corresponding entity table and not also a PK of
the relation table,
so in this case setting cascade to true will have no affect

Is this correct?

I tried to use this setCascade(true) but for me it seems not to work or I don't know how to
use it ;-(

Can anybody explain this or give a hint/link?

Thanks in advance,
Markus

-- 
/**
 * Markus Daniel
 * Bachelor of Science in Computer Science
 * Synyx GmbH & Co. KG
 * Karlstr. 68
 * 76137 Karlsruhe
 * phone  +49(0)721 66 48 79 31
 * fax    +49(0)721 66 48 877
 * eMail  markus.daniel@synyx.de
 * www    http://www.synyx.de
 * irc    http://irc.synyx.de
 */


Mime
View raw message