Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] case of table and column names

Adrian,

You raise a  valid issue that we also thought about a while back from a tooling perspective.  Our assumption (given that the spec was not specific) was that applications will run against a case insensitive database schema or will operate where default and specified values must match case sensitive database objects.  We decided that by default, we will ignore case when validating specified and default values, assuming a case insensitive database.  If the org.eclipse.jpt.db.internal.Database caseSensitive boolean is set to true, we will assume that the default or specified value must match the case of the database object in order to be valid and to have proper defaults.  We thought that this caseSensitive setting should be exposed as a user choice, but this is not yet implemented.

If a runtime were to uppercase defaults and also support defaults in a case sensitive DB scenario, then currently the Dali vendor extension would have to override our DB related logic where we retrieve tables and columns. 

I'm going to re-examine some of this issue and see if the current solution is the most appropriate.

Neil

Goerler, Adrian wrote:
Hi Dali-Dev Team,
 
in SAP JPA, we are facing an issue with the case of table and column names in conjunction with Dali, which I would like to hear your opinion on. 
 
The issue is the following:
 
SAP JPA always generates SQL with delimited identifiers, e.g. 
 
SELECT "E"."ID", "E"."NAME" FROM "EMPLOYEE" "E"
 
Therefore the case of table and column names is relevant for us. Unfortunately, the JPA specification is not specific with respect to the case of column and table names. We handle the case in SAP JPA as follows:
 
1) if a default rule applies: upper case
 
e.g.
 
@Basic
String name; -> "NAME"
 
 
2) if a table or column name is specified explicitly: mixed case
 
e.g.
 
@Column(name="theName")
String name; -> "theName"
 
 
Dali on the other hand, when applying default rules, seems to assume that either the case does not matter or that it is preserved (mixed case).
 
 
To fix the issue, I could imagine to have a property either in our (SAP) JPA runtime (specified in persistence.xml), in the SAP JPA Platform or in Dali that would allow to align the differing behaviours.
 
I would be interested to know which assumptions Dali makes with respect to the case of table and column names. What if the names are specified  explicitly using annotations or XML? What if default rules apply?
 
Are the other JPA vendors on this loop facing a similar issue?
 
Best regards,
 
Adrian
 

Dr. Adrian Görler
SAP AG
Dietmar-Hopp-Alee 16, 69190 Walldorf Germany
www.sap.com

Sitz der Gesellschaft/Registered Office: Walldorf, Germany
Vorstand/SAP Executive Board: Henning Kagermann (Sprecher/CEO), Léo Apotheker (stellvertretender Sprecher/Deputy CEO), Werner Brandt, Claus Heinrich, Gerhard Oswald, Peter Zencke
Vorsitzender des Aufsichtsrats/Chairperson of the SAP Supervisory Board: Hasso Plattner
Registergericht/Commercial Register Mannheim No HRB 350269
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.

 
 
 

_______________________________________________ dali-dev mailing list dali-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dali-dev

Back to the top