Community
Participate
Working Groups
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.
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.
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.
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?
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.
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
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.
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.
Sounds good. Holler if you need us.
Investigate for RC1.
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.
Fixed as a result of fixes for bug 242321.