Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] quoting problem with PostgreSQL

https://bugs.eclipse.org/bugs/show_bug.cgi?id=333739

On Jan 4, 2011, at 7:37 PM, Tom Ware wrote:

> Hi Martin,
> 
>  On closer examination, in my example, only some of the keys are being created with the delimiters.  Please file a bug.
> 
> -Tom
> 
> Martin Geisse wrote:
>> Hi Tom,
>> thank you for your reply. I was already using version 2.1.2. To be sure, I tried the 2.1.3 and 2.2.0 nightly builds, but the results are the same.
>> On Jan 4, 2011, at 3:22 PM, Tom Ware wrote:
>>> Hi Martin,
>>> 
>>> Response on both the mailing lists and the forums has been a little slow for the past couple of weeks due to the Holiday season.  It should start to improve over the next few days as the people that regularly reply get back.
>>> 
>>> This issue appears to be addressed in the latest EclipseLink versions.  I see it in the 2.0.x stream, but not in the latest stream.  Please try the latest version (2.1.2) from http://www.eclipse.org/eclipselink/downloads/.
>>> 
>>> -Tom
>>> 
>>> Martin Geisse wrote:
>>>> Hello,
>>>> I am moving this here from the community forum since the forum isn't very active and there seems to be little overlap in the people posting.
>>>> 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 (full contents below). That caused EclipseLink to quote most of the identifiers, but it specifically did not quote the column name when defining a foreign key constraint. How can I tell EL to quote all identifiers?
>>>> I have also tried using quotes in the explicitly specified table / column names to cause EL to quote identifiers. First and foremost, that doesn't work either -- same behavior. In addition to that, it forces me to specify names twice (in the annotation AND in the property accessor names) and in a manner that is invisible to refactoring tools. It also forces me to fix quoting at POJO level when it is actually a specific trait of the database system I am using.
>>>> Thank you in advance.
>>>> orm.xml:
>>>> ----------------------------
>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>> <entity-mappings version="1.0"
>>>>  xmlns="http://java.sun.com/xml/ns/persistence/orm";
>>>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>>>  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd">
>>>>  <description>description here</description>
>>>>  <persistence-unit-metadata>
>>>>      <persistence-unit-defaults>
>>>>          <delimited-identifiers />
>>>>      </persistence-unit-defaults>
>>>>  </persistence-unit-metadata>
>>>> </entity-mappings>
>>>> ----------------------------
>>>> entity class:
>>>> ----------------------------
>>>> @Entity
>>>> public class UserX {
>>>>  ...
>>>>  @Id
>>>>  @GeneratedValue(generator = "UserX_id_seq")
>>>>  @SequenceGenerator(name = "UserX_id_seq", allocationSize = 1)
>>>>  public int getId() { ... }
>>>>  ...
>>>>  @ManyToOne(fetch = FetchType.LAZY, optional = false)
>>>>  public UserX getModificationUser() { ... }
>>>> }
>>>> ----------------------------
>>>> the generated query (note the missing quotes around the column name):
>>>> ----------------------------
>>>> ALTER TABLE "UserX" ADD CONSTRAINT "FK_UserX_modificationUser_id" FOREIGN KEY (modificationUser_id) REFERENCES "UserX" (id)
>>>> ----------------------------
>>>> _______________________________________________
>>>> eclipselink-users mailing list
>>>> eclipselink-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Back to the top