Fabio Oliveira
2003-07-03 10:13:16 UTC
Dear friends:
I'm having problems with middlegen and MySQL in multiple foreign keys
database relationship.
My configuration:
- MySQL 4.0.13, for pc-linux (i686)
- Driver JDBC mysql-connector-java-3.0.0-beta-bin.jar (I try with the
last version and occurs the same problem)
- middlegen 2.0 b1
If i create only one column in foreign key, the relation work, but when
i put more 1 column, middlegen display this warning:
[middlegen] (middlegen.MiddlegenPopulator 222 ) WARNING:
Middlegen couldn't find any relations between any tables. This may be
intentional from the design of the database, but it may also be because
you have incorrectly defined the relationships. It could also be because
the JDBC driver you're using doesn't correctly implement
DatabaseMetaData. See the samples (for an example on how to define
relationships) and verify that your driver correctly implements
DatabaseMetaData.
My Mysql Script is:
create table a (campo1 integer not null,
campo2 integer not null,
primary key (campo1,campo2)
) type=innodb;
create table b(campo3 integer not null,
campo4 integer not null,campo5 integer not null,campo6 integer not null,
primary key (campo3,campo4),
index i2 (campo5,campo6),
foreign key (campo5,campo6) references a (campo1,campo2)
) type=innodb;
I read the instructions of Aslak in Myddlegen page.
" Requires MySQL 3.23.43b (or higher) with InnoDB enabled and MM.MySQL
2.0.9 or higher. The table names must be define in lower case, otherwise
no relations will be discovered. If you have relations using foreign
keys that consist of multiple columns, you should use the driver shipped
with Middlegen. It has a bugfix which isn't yet fixed in the official
driver."
My driver is the same with middlegen distribution, my tables was in
lower case, but don't works!
My mysql.xml
property name="database.script.file"
value="${src.dir}/sql/${name}-mysql.sql"/>
<property name="database.driver.file"
value="${lib.dir}/mysql-connector-java-3.0.0-beta-bin.jar"/>
<property name="database.driver.classpath"
value="${database.driver.file}"/>
<property name="database.driver"
value="org.gjt.mm.mysql.Driver"/>
<property name="database.url"
value="jdbc:mysql://localhost/webfor"/>
<property name="database.userid" value="root"/>
<property name="database.password" value=""/>
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
<property name="jboss.datasource.mapping" value="mySQL"/>
I need help...
Fábio.
I'm having problems with middlegen and MySQL in multiple foreign keys
database relationship.
My configuration:
- MySQL 4.0.13, for pc-linux (i686)
- Driver JDBC mysql-connector-java-3.0.0-beta-bin.jar (I try with the
last version and occurs the same problem)
- middlegen 2.0 b1
If i create only one column in foreign key, the relation work, but when
i put more 1 column, middlegen display this warning:
[middlegen] (middlegen.MiddlegenPopulator 222 ) WARNING:
Middlegen couldn't find any relations between any tables. This may be
intentional from the design of the database, but it may also be because
you have incorrectly defined the relationships. It could also be because
the JDBC driver you're using doesn't correctly implement
DatabaseMetaData. See the samples (for an example on how to define
relationships) and verify that your driver correctly implements
DatabaseMetaData.
My Mysql Script is:
create table a (campo1 integer not null,
campo2 integer not null,
primary key (campo1,campo2)
) type=innodb;
create table b(campo3 integer not null,
campo4 integer not null,campo5 integer not null,campo6 integer not null,
primary key (campo3,campo4),
index i2 (campo5,campo6),
foreign key (campo5,campo6) references a (campo1,campo2)
) type=innodb;
I read the instructions of Aslak in Myddlegen page.
" Requires MySQL 3.23.43b (or higher) with InnoDB enabled and MM.MySQL
2.0.9 or higher. The table names must be define in lower case, otherwise
no relations will be discovered. If you have relations using foreign
keys that consist of multiple columns, you should use the driver shipped
with Middlegen. It has a bugfix which isn't yet fixed in the official
driver."
My driver is the same with middlegen distribution, my tables was in
lower case, but don't works!
My mysql.xml
property name="database.script.file"
value="${src.dir}/sql/${name}-mysql.sql"/>
<property name="database.driver.file"
value="${lib.dir}/mysql-connector-java-3.0.0-beta-bin.jar"/>
<property name="database.driver.classpath"
value="${database.driver.file}"/>
<property name="database.driver"
value="org.gjt.mm.mysql.Driver"/>
<property name="database.url"
value="jdbc:mysql://localhost/webfor"/>
<property name="database.userid" value="root"/>
<property name="database.password" value=""/>
<property name="database.schema" value=""/>
<property name="database.catalog" value=""/>
<property name="jboss.datasource.mapping" value="mySQL"/>
I need help...
Fábio.