Community
Participate
Working Groups
Build Identifier: 20110218-0911 If you create an Entity named with a MySQL's Reserved Name, the "Generate Table from Entities" function came out with a sql string with sintax error. We can easy work around it by forcing the correct name with @Table annotation, but you still need to add double quotes to use a correct name (e.g. "@Table (name = "\"Call\"") ). IMHO the @Table (name = "") annotation has the responsibility to set the correct entity name that you want and not used to set the right SQL for the generator. There's an open tread in the forum http://www.eclipse.org/forums/index.php?t=rview&goto=667901#msg_667901 Reproducible: Always Steps to Reproduce: 1. Create an Entity with a reserved MySQL name (e.g. Call) 2. Create a correct persistence.xml and sync it with your entity 3. Use "Generate Table from Entities" to get the error
I checked the DTP MySQL 5.0 definition in DTP and "CALL" is listed as a reserved word meaning that our Entity Gen should already be specifying and delimiting this table name for you as the bug suggests. Are you defining your DB connection using the MySQL connection profile type and the MySQL JDBC Driver 5.0 driver template?
(In reply to comment #1) > I checked the DTP MySQL 5.0 definition in DTP and "CALL" is listed as a > reserved word meaning that our Entity Gen should already be specifying and > delimiting this table name for you as the bug suggests. Are you defining your > DB connection using the MySQL connection profile type and the MySQL JDBC Driver > 5.0 driver template? Sorry...was thinking this was Entity Gen for a minute, forgot it was Table Gen that we were talking about. I'll check to see how EclipseLink is supposed to behave in this case and get back to you. It may be a bug or enhancement request for EclipseLink.
EclipseLink recommends not using reserved words in your model if possible and if you must then you must delimit them as required. You could file an enhancement against the RT->EclipseLink project to request this functionality but I don't think it is very likely to be changed. Closing this out as it is not a Dali specific issue.
See bug 260637 for the EclipseLink issue.