Discussion:
[Middlegen-user] Probelm with Middlegen and table relationships
Jordan Thomas
2002-06-11 08:50:02 UTC
Permalink
Hi,

I am trying to simply import my database schema from MYSQL into the
Middlegen GUI. This is easy enough but my problem is that middlegen does
not recognise the relationships within my database schema. Am I doing
somethin wrong here. All of the tables are set to InnoDB and I using the
altest mm.Mysql driver. I've included the sql file just in case. I am at
an end here. Any help would be great.

cheers

Jordan
a***@netcom.no
2002-06-11 09:28:03 UTC
Permalink
Howdy Jordan,

<quote>
middlegen does not recognise the relationships within my database schema
</quote>
Well' it's not Middlegen that doesn't recognise the relationships, it's
the JDBC driver....

Here is what you should do:

1) AFAIK you can't ALTER the table type. It has to be defined during
table creation.
2) If a fk in table A references a column in B, then B must be created
before A. You don't do that, and you have typos in some of the table
references. Those mistakes aren't reported because you don't respect
point 1. MySQL just ignores foreign keys for regular table types.
3) IIRC you also need an INDEX for each FK.
4) IIRC there is also a bug in InnoDB which requires table names to use
small letters only (otherwise relations won't work)

See middlegen/samples/src/sql/airline.mysql for an example about how to
do all this correctly.

HTH,
Aslak

Content-Type: multipart/alternative;
boundary="----=_NextPart_001_001B_01C21146.61B54DD0"


------=_NextPart_001_001B_01C21146.61B54DD0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi,

I am trying to simply import my database schema from MYSQL into the
Middlegen GUI. This is easy enough but my problem is that middlegen does
not recognise the relationships within my database schema. Am I doing
somethin wrong here. All of the tables are set to InnoDB and I using the
altest mm.Mysql driver. I've included the sql file just in case. I am at
an end here. Any help would be great.

cheers

Jordan

------=_NextPart_001_001B_01C21146.61B54DD0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<TITLE>Message</TITLE>

<META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D932054010-11062002><FONT face=3DArial=20
size=3D2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=3D932054010-11062002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D932054010-11062002><FONT face=3DArial size=3D2>I am =
trying to=20
simply import my database schema from MYSQL into the Middlegen GUI. This =
is easy=20
enough but my problem is that&nbsp;middlegen does not recognise the=20
relationships within my database schema. Am I doing somethin wrong here. =
All of=20
the tables are set to InnoDB and I using the altest mm.Mysql driver. =
I've=20
included the sql file just in case. I am at an end here. Any help would =
be=20
great.</FONT></SPAN></DIV>
<DIV><SPAN class=3D932054010-11062002><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D932054010-11062002><FONT face=3DArial=20
size=3D2>cheers</FONT></SPAN></DIV>
<DIV><FONT size=3D+0><SPAN class=3D953194911-04062002><FONT face=3DArial =

size=3D2></FONT></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT size=3D+0><SPAN class=3D953194911-04062002><SPAN=20
class=3D932054010-11062002><FONT face=3DArial=20
size=3D2>Jordan</FONT></SPAN></DIV></SPAN></FONT></BODY></HTML>

------=_NextPart_001_001B_01C21146.61B54DD0--

Loading...