FAQ
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

Search Discussions

  • Andrus Adamchik at Apr 15, 2006 at 5:31 pm
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedApr 14, '06 at 1:41p
activeApr 15, '06 at 5:31p
posts2
users2
websitecayenne.apache.org

2 users in discussion

Andrus Adamchik: 1 post Borut Bolčina: 1 post

People

Translate

site design / logo © 2022 Grokbase