|Re: JPA Query generate uppercase field names [message #376368 is a reply to message #376367]
||Thu, 17 July 2008 15:41
| Brian Vosburgh
Registered: July 2009
Gordon Yorke wrote:|
> It is throughout the rules for default naming. Look at page 26-27 for
> foreign key column names. There's an example on page 35 the shows the
> defaults for non-relationship column names. It is very clear throughout
> these sections that the specification intends for default column names
> to be an upper case version of the property name.
I disagree that "it is very clear". If it were "clear", it would be
unequivocably stated in the text of the spec. When I asked co-spec lead
Mike Keith for clarification of this issue, he said "the spec does not
address it". The use of uppercase in any particular example is because
that is the actual name of the particular database object in that example.
The use of uppercase also makes it easier for the reader to discern when
the example is referring to a database identifier and when it is referring
to a database identifier.
Folding to uppercase *is* a typical way of handling undelimited identifiers
(in fact the SQL standard demands it); but, by default, numerous popular
databases do NOT fold to uppercase (and violate the SQL spec). PostgreSQL,
Informix, and (sometimes) MySQL fold to lowercase; while Microsoft and Sybase
do not fold at all.
As counterpoints in the spec, the "default" Entity name is NOT folded to
uppercase; and the none of the descriptions of the annotations mention
anything about folding the defaults to uppercase. For example, the table
on page 164 says the default for Table.name is "Entity name", not "Entity
name folded to uppercase". Does not the the "Entity name" have the same
case as the Java identifier? Likewise the table on page 167 says the
default for Column.name is "The property or field name" - nothing about
folding to uppercase.
Sorry about the excess of details, but I'm in the middle of handling
case-sensitivity issues in Dali. :) In Dali we will likely be using the
identifiers unmodified and allowing for a setting that allows us to ignore
case. Sort of the opposite of your earlier suggestion for an EclipseLink
setting. Needless to say, the issue is difficult.
Powered by FUDForum
. Page generated in 0.04061 seconds