Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 334454

Summary: Cannot resolve tables names
Product: [WebTools] Dali JPA Tools Reporter: c2951487
Component: GeneralAssignee: Brian Vosburgh <brian.vosburgh>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: geraskov, manderse, neil.hauge, vyemialyanchyk
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description c2951487 CLA 2011-01-15 06:35:15 EST
Build Identifier: 20100917-0705

Setup: Eclipse 3.6 Helios, MySQL 5.5.8

It seems that the DALI tools does a case sensitive comparison on the entity 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. However, on Unix (and Mac I believe) lettercase is preserved by default by MySQL.

Workaround:
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 ). 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.

Reproducible: Always

Steps to Reproduce:
1. Create new project with the 'JPA Project' wizard
2. Create simple Entity class called: MyEntity (note the use of both upper and lower case letter, as it normal)
3. The corresponding table was created with a DDL file made by the JPA Tools -> Generate Tables from Entities... wizard. (Lettercase is preserved in the statements of the DDL file)
4. Error will show in Eclipse: Table "MyEntity" cannot be resolved
5. Create a new entity class called: lowercase (note only the use of lower case letter in the class name)
6. Create DLL file and table in the database
7. No errors will be reported in Eclipse on class: lowercase
Comment 1 Neil Hauge CLA 2011-01-28 16:24:22 EST
Brian has been looking at this.
Comment 2 Brian Vosburgh CLA 2011-03-09 17:46:27 EST
Dali now queries MySQL for the value of the system variable lower_case_table_names and behaves appropriately.

Fix will be in M6.