[hibernate-dev] Table and quoted names

Juraci Paixao Krohling jcosta at redhat.com
Mon Oct 4 05:17:55 EDT 2010


On 10/01/2010 07:57 PM, Steve Ebersole wrote:
> The vast majority of databases out there have more or less decent JDBC
> drivers.  So forcing every single Dialect to reproduce information that
> is already correctly available to us because of a few *known* slackers
> seems silly.  Why can't the majority of Dialect's say "you know what...
> you can already get this information via the driver's DatabaseMataData;
> go look there"?  Thats all I'm saying.

I agree with that. All I'm saying is that there should be a fall back, 
in case someone needs to use a specific driver, but which is faulty in 
this specific area. I'd again use the Sybase JDBC4 driver as example. It 
fixed some of the bugs we were having with the older driver, but it 
introduced this new bug.

> So because Sybase has crappy JDBC drivers (ok thats a tad harsh, but
> making a point...) we need to penalize every Dialect developer into
> duplicating this information?

No. I'd say that we can rely on JDBC meta data by default, but there 
should be a fall back.

> For something like this, here is what I would propose...
>
> 1)
> public interface ObjectNameRenderer {
>      public String render(OjectName objectName);
> }
>
> 2)
> Dialect {
>      ...
>      ObjectNameRenderer getObjectNameRenderer() {
>          return TrustMetaDataObjectNameRenderer.INSTANCE;
>      }
> }
>
> And also allow one to be plugged in via "config", which would take
> precedence if present.

That's exactly the kind of fall back I'm talking about :-)

- Juca.



More information about the hibernate-dev mailing list