Re: DbGenerator

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Mar 07 2006 - 11:03:34 EST

  • Next message: Andrus Adamchik: "Re: DbGenerator"

    Not a problem. Current detection works by checking the default table
    type. This is not perfect as you may have default type set to MyISAM,
    but InnoDB tables may still be supported. So...

    1. Can you manually run this query and post the output (this is just
    to check that current imperfect detection works):

    SHOW VARIABLES LIKE 'table_type'

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

    Andrus

    On Mar 7, 2006, at 6:47 PM, Paul Furbacher wrote:
    > On Mar 3, 2006, at 5:42 AM, Andrus Adamchik wrote:
    >
    >> Current MySQLAdapter was designed for the MyISAM tables that do
    >> not support constraints. I just added InnoDB autodetection and
    >> constraint support code to the adapter. It should work in the next
    >> nightly build (note that you'll have to delete explicit
    >> MySQLAdapter for the DataNode in the Modeler, so that Cayenne
    >> autodetection could kick in).
    >
    > Is this working in the March 7, 2006 daily build? I have a MySQL
    > db which
    > definitely has foreign keys defined for a number of tables, yet when I
    > used Modeler, set the DataSource adapter to "Automatic", and then
    > "Re-engineer Database Schema" followed by "Generate Schema", select
    > "Create FK Support", no foreign key constraints show up in the
    > generated
    > SQL.
    >
    > I must be doing something wrong, but can't imagine what.
    >
    > Sorry to be a bother.
    >
    >
    > Paul Furbacher
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Mar 07 2006 - 11:03:38 EST