Re: Modeler: Reengineer from MySQL Server

From: Jorge Sopena (jsopen..idsa.es)
Date: Tue Nov 04 2003 - 07:40:34 EST

  • Next message: Andrus Adamchik: "Re: Modeler: Reengineer from MySQL Server"

    Hi Andrus,

    If I'm not wrong, MySql is supposed to support referential integrity
    constraints when the tables are of InnoDB type.
    I checked it in MySql v4.0.x.

    Even If you don't define your tables as InnoDB, MySql must save
    information about foreign keys. Because if you open the schema with
    the Control Center tool the fields that are foreign keys are identified,
    although then the referential integrity is not supported.

    Maybe it's not supported by the driver?

    Jorge

    Andrus Adamchik wrote:

    > Hi Jorge,
    >
    > The reason why relationships were not discovered by Cayenne is because
    > of MySQL. It does not support referential integrity constraints, and
    > these constraints are exactly the piece of information used by Cayenne
    > to infer relationships. E.g. On Oracle or Sybase this would've worked
    > fine.
    >
    > As for the methodology, my recommendation would be to reverse
    > engineer what you can, then create relationships manually, and on
    > future database changes do the manual model updates (assuming that
    > changes to any existing DB are normally pretty minor, this shouldn't
    > be a big deal).
    >
    > Andrus
    >
    >
    > On Oct 31, 2003, at 10:43 AM, Jorge Sopena wrote:
    >
    >> I'm new to Cayenne...
    >>
    >> So the first thing I've done is to Reengineer my MySql database.
    >> I got it to connect to DB fine.
    >> All the ObjEntities and DBEntities were recovered well with its
    >> attributes.
    >> But all of them were created without any relationship.
    >> Is there any way to get the relationships from the DB with the
    >> Reengineer means?
    >> If not, how can I preserve the relationships I create from the next
    >> Reengineer I do?
    >> Because, If my DB change and I want to recover the new schema, all
    >> the relationships I did manually in the modeler dissappeared.
    >>
    >> Thanks in advance,
    >>
    >> Jorge
    >>
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Nov 04 2003 - 07:33:23 EST