Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334454 - Cannot resolve tables names
Summary: Cannot resolve tables names
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Brian Vosburgh CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-15 06:35 EST by c2951487 CLA
Modified: 2011-03-09 17:46 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.