Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 228937 - Dali does not handle Quoted Table Names correctly
Summary: Dali does not handle Quoted Table Names correctly
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 1.0.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1 M2   Edit
Assignee: Brian Vosburgh CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 242321
Blocks:
  Show dependency tree
 
Reported: 2008-04-25 15:33 EDT by Tim Hollosy CLA
Modified: 2008-09-30 13:37 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Hollosy CLA 2008-04-25 15:33:36 EDT
In postgres upper case table names must be quoted, if I have a view named:

employees and a table named EMPLOYEES if I want to select against the table EMPLOYEES I must write my select like SELECT * FROM "EMPLOYEES".

So my JPA entities need to look like:

@Entity
@Table(name="\"EMPLOYEES\"")

My problem is sometimes JPA tools recognizes my quotes table name and does it's compile checks against the correct entity. Other times it does not, it will act like it cannot find the entity.

I wish I could be more precise about when it accepts it, and when it doesn't. Right now I have one project where the quoting is fine, and another where it will not recognize the quoting at all.
Comment 1 Karen Butzke CLA 2008-04-25 17:31:34 EDT
I hate to ask the obvious, but in both projects are you actually connected to the database?  If you are not connected, Dali will not give any validation errors for table/column names.  Or maybe you don't have a connection defined, but you would see a warning for that.
Comment 2 Tim Hollosy CLA 2008-04-28 08:28:11 EDT
Karen,
That's not what's happening. I have disconnected, reconnected, retyped the @Table definition -- It still will not recognize the quoted table  (in this project). I have another project where it recognized the quoted table just fine.

It's really bizarre, and I'm about to give up on JPA tools and just trust that my JPA implementation (EclipseLink) will complain if it doesn't work.
Comment 3 Karen Butzke CLA 2008-04-28 09:33:42 EDT
Which version of Dali are you using?

I am trying to narrow down the location of this bug.  Dali uses DTP for table information used in populating our drop-downs, code assist, and for validation.  So, it is definitely bizarre that you would see this work in one project and not in another.  This is why I was asking if your connection is not working in the project where you have no validation errors.  In the valid project, are you seeing tables/columns in the JPA combo boxes or when using code assist for Table and Column annotations?
Comment 4 Tim Hollosy CLA 2008-04-28 09:57:22 EDT
I'm on 1.0.2 of Dali Java Persistence API.

Update: Let me add, that I dont think it handles quoting correctly at all now. On the project that was working while quoted, I just changed the name retyped it, causing a revalidation (while connected this time) and it fails. So you were right about it just not validating while disconnected.

This is kind of a deal breaker for me in using JPA Data Tools since I have many databases with this convention of all upper case tables that must be quoted to be referenced in postgres.

Comment 5 Karen Butzke CLA 2008-04-28 10:08:20 EDT
Assigning to Data Tools (DTP) .  Do you guys know if upper case quoted tables are support for postgres database?  Eclipse Dali 1.0.2 uses DTP version 1.5.2_022008
Comment 6 Brian Fitzpatrick CLA 2008-04-28 10:30:51 EDT
Unfortunately, I don't know offhand and neither does the guy who's done most
with Postgres support. You'd need to check the PostgreSQL documentation for it.
Comment 7 Karen Butzke CLA 2008-04-29 09:06:28 EDT
I'm taking this one back to the Dali team.  After some more investigation, there are things we need to be doing to handle case sensitive databases and the possibility of quoted identifiers.  It is possible there is something that could help us out from DTP, but we'll open separate bugs if that is the case. 
Comment 8 Brian Fitzpatrick CLA 2008-04-29 12:26:16 EDT
Sounds good. Holler if you need us. 
Comment 9 Neil Hauge CLA 2008-05-01 11:45:02 EDT
Investigate for RC1.
Comment 10 Neil Hauge CLA 2008-05-21 00:06:35 EDT
We need a comprehensive case-sensitivity solution, which cannot be implemented at this point for the 2.0 release.  Handling quoted names will (probably) be a specific part of that solution.  Re-targeting for the next release.
Comment 11 Brian Vosburgh CLA 2008-09-29 17:03:33 EDT
Fixed as a result of fixes for bug 242321.