Hi Francisco,

cascade delete relies on the capability of the database to do so. Traditionally, MySQL has been ignoring the constraints on any tables, however it recently has been added to InnoDB tables, more information here: http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key- constraints.html

So you have to make sure that MySQL is using InnoDB tables, this can be done easily by specifying it as the default table type in the my.cnf file: http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html

Hope this helps.

Best regards,

Geert

PS.: this is pretty much deduction from docs and previous experience, I never actually use MySQL and other people might have some more info for you

On 16 Oct 2006, at 14:45, Francisco Treacy wrote:

Hi!

I started using Rife a few days ago, namely with Rife/Crud. I got a very simple sample app working (three domain objects + their associated metadata) but I wanted to be able to "cascade delete" directly from the default Crud screens, and I can't find the way to make it happen. Say I have a Category class and a BlogEntry one, linked by a many- to-one relationship. I would like all blog entries to disappear whenever its category is removed. When the Crud participant creates the tables in my MySQL database, it doesn't generate any foreign keys, thus the "on delete cascade" attribute cannot be present. I suppose this is the reason why.

Is there a way / workaround to make this work (wanting my tables to be generated by Rife)? I played with the "CreateTable.CASCADE" stuff in the manyToOne method, but I don't understand exactly its purpose, neither it solved my problem.

Any ideas?

Thanks in advance,
Francisco

Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! Demandez à ceux qui savent sur Yahoo! Questions/Réponses.
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to