[jboss-user] [JBoss Tools] - JPA Project - cannot resolve tables

Claus Dreyer do-not-reply at jboss.com
Tue Jan 11 17:21:17 EST 2011


Claus Dreyer [http://community.jboss.org/people/cdreyer1] created the discussion

"JPA Project - cannot resolve tables"

To view the discussion, visit: http://community.jboss.org/message/580153#580153

--------------------------------------------------------------
Hi,

I have a simple project made with the 'JPA Project' wizard. My development setup is Eclipse 3.6 Helios, JBoss Tools 3.2.CR1 and MySQL 5.5.8. Everything is running on Windows.

The problem is that I get the error *Table "MyEntity" cannot be resolved*

The entity class MyEntity is a very simple test class. The corresponding table was created with a DDL file made by the JPA Tools -> Generate Tables from Entities... wizard.

I have tried many things to get it to work. I finally made an entity class called lowercase (all of the letters are lower case), and suddenly it worked...

It seems that the tools (I don't know if it is JBoss Tools or Dali) does a case sensitive comparison on the class name and table name. By default MySQL on Windows converts all table names to lower case. This is not the case for column names where lettercase is preserved. On Unix (and Mac I believe) lettercase is preserved by default by MySQL.

MySQL has a global system variable called +lower_case_table_names+ (see MySQL doc:  http://dev.mysql.com/doc/refman/5.5/en/identifier-case-sensitivity.html Identifier Case Sensitivity). According to the MySQL documentation it can be set to 2 (instead of 1) and lettercase will be preserved on Windows. However, this has implications for your database statements which now must have the correct lettercase.

I have tried to start MySQL with lower_case_table_names=2, then drop the existing database, re-create the database, run the DDL for my two simple classes mentioned above and then the tools work.

I don't know if this issue should be classified as a bug or just filed on quirks related to MySQL.

Kind regards,
Claus
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/580153#580153]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110111/c666b71c/attachment.html 


More information about the jboss-user mailing list