-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: hibernate and middlegen and myisam
PostPosted: Tue Oct 05, 2004 6:05 pm 
Newbie

Joined: Tue Oct 05, 2004 5:42 pm
Posts: 2
Location: Boston MA
Hi,

I'm using hibernate 2.1, Middlegen 2.0-vo, MySQL 4.0.20d with MyISAM tables, mysql-connector-java-3.0.15-ga, ant 1.6.2, Linux 2.4.21-4.EL and everything seems to work fine. The gui comes up and I can view the tables of my database. Problem is the relationships are not visible. I ran ant with verbose flag and the following message was logged:


"WARNING: Middlegen couldn't find any relations between any tables."


I've noticed in the forum some posts regarding the driver for this problem, but this is the latest jdbc driver available from the MySQL site. Also, I will not be able to convert the tables from MyISAM to InnoDB. Is there anyway around this using Middlegen or possibly another tool similiar to Middlegen?

Thanks...

Mike

_________________
Mike Sousa
Software Engineer
BAE Systems


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 05, 2004 9:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Here is some MySQL information from the Middlegen site:

Quote:
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.

On Win32 with MySQL 4.0.18 (or higher) + JDBC 3.0.14 (or higher), set lower_case_table_names=2 in my.ini. This will force InnoDB tables to be stored in lower-case, and will solve the above problem with relations discovery. The tables can still be referred to my their upper/proper case names, but will be converted to lower-case during the query. Not tested, but expect that lower_case_table_names to either 1 or 2 on Linux will have similar results.

Tested multi-column FKs with MySQL 4.0.20 and JDBC 3.0.14, and multi-column FKs appeared to work.


Top
 Profile  
 
 Post subject: hibernate and middlegen and myisam
PostPosted: Wed Oct 06, 2004 2:10 pm 
Newbie

Joined: Tue Oct 05, 2004 5:42 pm
Posts: 2
Location: Boston MA
Thanks David,

I had seen those notes on the MySQL website. Unfortunately, I cannot change the tables in my database from MyISAM to InnuDB. My guess is I will just have to do the Hibernate mapping files by hand unless someone in this list knows of another way of automatically generating Hibernate mapping files for MySQL with MyISAM tables.

Thanks...

Mike

_________________
Mike Sousa
Software Engineer
BAE Systems


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 4:15 pm 
Newbie

Joined: Tue Sep 14, 2004 10:57 am
Posts: 12
Also becareful.. MyISAM are not transaction safe table type
http://dev.mysql.com/doc/mysql/en/Table_types.html



-Jay


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.