db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Watzek <mwa.t...@spree.de>
Subject Re: JPOX generated tablenames
Date Tue, 12 Jul 2005 10:24:34 GMT
Hi Andy,

>>I understand that many databases restrict SQL identifiers to a length of
>>30 characters, though SQL92 specifies a max length of 128 characters.
>>
>>What is the reason, that JPOX mangels tablenames specified in the orm
>>metadata?
> 
> 
> Something that had been in the codebase from before its JPOX lifetime and that 
> I'd meant to remove (so I just did - thanks for reminding me) :-).
> 
> Derby accepts table names up to 30 chars in length. If the user specifies 
> anything longer than 30, the last part of the name is hashed so we limit the 
> specified tablename to 30 chars. If the user specifies a name of 30 chars or 
> less then it is now preserved.
I think, mangling of tablenames does only make sense in the case of 
forward engineering when the orm metadata and the SQL schema are generated.

In the case, where the orm metadata and the SQL schema are given by the 
user, JPOX should not mangle tablenames. Otherwise, you cannot be sure 
that there is a suitable table in the database.

Currently, you can see this phenomenon when you run the TCK: there are 
about 5 errors "Table 'xxx' does not exist", e.g. the classname is 
"HashtableStringKeyCollections", the orm metadata maps it to a tablename 
"HASHTABLESTRINGKEY_COLLECTIONS" (this tablename is also used in the SQL 
schema), but the JPOX generated tablename  name is 
"HASHTABLESTRINGKEY_COLLET8".

Another question: The Derby Reference Manual Version 10, June 11, 2005, 
specifies that table names in Derby conform to SQL92 indentifiers. SQL92 
identifiers have a max length of 192 unicode characters. So, I'm not 
sure about the Derby restriction of 30 characters for identifiers which 
you mention above.

Regards,
Michael
-- 
-------------------------------------------------------------------
Michael Watzek                  Tech@Spree Engineering GmbH
mailto:mwa.tech@spree.de        Buelowstr. 66
Tel.:  ++49/30/235 520 36       10783 Berlin - Germany
Fax.:  ++49/30/217 520 12       http://www.spree.de/
-------------------------------------------------------------------

Mime
View raw message