[hibernate-dev] Table and quoted names

Max Rydahl Andersen max.andersen at redhat.com
Fri Oct 1 08:31:52 EDT 2010


Got them this time.

Looks like quoting is done all good there.

Looking at it reminded me of http://opensource.atlassian.com/projects/hibernate/browse/HHH-1476

The problem of the separators actually having to be dialect controlled and even in some cases schema
can be skipped resulting in catalog..table. Worth covering ?

/max


On Sep 30, 2010, at 21:13, Steve Ebersole wrote:

> Hmm a few other people said they did not get them either.  Trying
> again...
> 
> On Thu, 2010-09-30 at 10:37 -0500, Steve Ebersole wrote:
>> ?  
>> 
>> They came back through to me.
>> 
>> On Thu, 2010-09-30 at 17:21 +0200, Max Rydahl Andersen wrote:
>>> missing attachement?
>>> 
>>> /max
>>> 
>>> On Sep 30, 2010, at 15:01, Steve Ebersole wrote:
>>> 
>>>> True enough.  Attached is the code I developed for Hibernate 4 to handle
>>>> this better.  Care to gander?
>>>> 
>>>> 
>>>> On Thu, 2010-09-30 at 15:09 +0300, Dmitry Geraskov wrote:
>>>>> Hi, guys,
>>>>> while I was fixing some bug in hibernate tools I looked through some 
>>>>> hibernate code.
>>>>> And it seems to me that hibernate is not ready in some cases for quoted 
>>>>> identifiers.
>>>>> 
>>>>> Here I would like to highlight some potentially weak places in key class 
>>>>> org.hibernate.mapping.Table.
>>>>> It doesn't ready for quoted catalog identifiers.
>>>>> There are (catalog, schema, name) fields and (schemaQuoted,quoted). 
>>>>> There is no "catalogQuoted", but probably it should be.
>>>>> The static method qualify() in most cases used to generate unique key 
>>>>> and cache some data. It is used in such way:
>>>>> 
>>>>> String key = Table.qualify(catalog, schema, name);
>>>>> and it is a potentially(non-unique) problem if there are names with dots.
>>>>> "catalog.my.schema.table" = "catalog.my"."schema"."table" or 
>>>>> "catalog"."my.schema"."table".
>>>>> 
>>>>> I didn't find any usage of Table#isSchemaQuoted(), and 
>>>>> DatabaseMetadata#getTableMetadata(..., isQuoted) called with 
>>>>> Table#isQuoted() parameter. Perhaps there should be
>>>>> isQuoted = Table#isQuoted() || Table#isSchemaQuoted() || 
>>>>> Table#isCatalogQuoted() ?
>>>>> 
>>>>> Dmitry Geraskov.
>>>>> _______________________________________________
>>>>> hibernate-dev mailing list
>>>>> hibernate-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>>> 
>>>> -- 
>>>> Steve Ebersole <steve at hibernate.org>
>>>> http://hibernate.org
>>>> _______________________________________________
>>>> hibernate-dev mailing list
>>>> hibernate-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>> 
>> 
> 
> -- 
> Steve Ebersole <steve at hibernate.org>
> http://hibernate.org
> <Identifier.java><ObjectName.java>





More information about the hibernate-dev mailing list