Community
Participate
Working Groups
Build Identifier: M20100909-0800 With PostgreSQL, I have to double-quote all identifiers or they'll be implicitly lower-cased. I'd prefer to preserve case since "lastLoginAttemptIpAddress" is so much more readable than "lastloginattemptipaddress". I have created an orm.xml file with <delimited-identifiers /> (full contents attached, as is the source code for the entity class). That caused EclipseLink to quote most of the identifiers, but it specifically did not quote the column name when defining a foreign key constraint. I was advised on the eclipselink-users mailing list to file this as a bug. The offending SQL command is (note the missing quotes around the column name): ALTER TABLE "UserX" ADD CONSTRAINT "FK_UserX_modificationUser_id" FOREIGN KEY (modificationUser_id) REFERENCES "UserX" (id) I have also tried using quotes in the explicitly specified table / column names to cause EL to quote identifiers, but the behavior is exactly the same. This behavior occurs in EclipseLink versions 2.1.2, as well as the 2.1.3 and 2.2.0 nightly builds. Reproducible: Always Steps to Reproduce: 1. use a database that demands delimited identifiers such as PostgreSQL with uppercase letters in the identifiers 2. define an entity class with a ManyToOne relation to cause EclipseLink to create a foreign key constraint 3. enable DDL generation such that the cosntraint creation command is actually sent to the database 4. use <delimited-identifiers /> to cause identifiers to be delimited, which doesn't happen in all cases
Created attachment 186267 [details] source code for the entity class
Created attachment 186268 [details] orm.xml
The issue also occurs with <delimited-identifiers /> and CriteriaBuilder.function(...): The function name is not delimited either. However, in this case adding explicit double-quotes in the function name (the first argument to CriteriaBuilder.function()) causes EclipseLink to quote the function name in the SQL command. So the course of action seems to be different here: quoting *is* possible, just <delimited-identifiers /> does not enable it.
Another occurence: For a column with @SequenceGenerator, the sequence name is not quoted automatically. Adding explicit quotes in the sequence name fixes the problem just like it does for function names.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Another scenario in which identifiers are not qualified is the schema name when using the H2 database. Typically this will result in tables named Planner."tblShift" rather than "Planner"."tblShift"
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink