db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <tfisc...@apache.org>
Subject Re: criteria.setCascade(true)
Date Mon, 18 Dec 2006 09:14:08 GMT
I have also tried to figure it out once but could not understand what is 
happening.

Because the torque team tried not to make any big changes in the 3.3 
release, this was left as it is. Personally, I do not believe it does 
anything useful.

      Thomas

On Sun, 17 Dec 2006, Markus Daniel wrote:

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

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