Yes, it is implemented. However it relies on the database default to be InnoDB.

Unfortunately there is currently no way to turn it on or off in the Modeler (you can still do it in the code at runtime, but the modeler will look at the DB default). One possible solution is the custom adapter that extends MySQLAdapter and in constructor calls "setSupportsFkConstraints(true)".

Andrus


On Apr 14, 2006, at 5:33 PM, Borut Bolčina wrote:

Hi Andrus,

is CREATE TABLE syntax (ENGINE=InnoDB) already implemented? I have mysql database server with MyISAM default (company policy), so Modeler and DbGenerator are not outputing fk sql statements. I tried beta1 with no success.

-Borut

On 7.3.2006 17:05, Andrus Adamchik wrote:

On Mar 7, 2006, at 7:03 PM, Andrus Adamchik wrote:

2. Here is a manual solution. If you are running DbGenerator from the code (not the Modeler), you can change the adapter back to "org.objectstyle.cayenne.dba.mysql.MySQLAdapter" and inside your code call "setSupportsFkConstraints(true)":

DbAdapter adapter = ...
((MySQLAdapter) adapter).setSupportsFkConstraints(true);

Hmm... on the other hand if the default is not InnoDB, we also need to change CREATE TABLE syntax to enforce InnoDB. I need to patch the adapter further.

Andrus




Reply via email to