Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4 - Mailing list pgsql-jdbc

From Lew
Subject Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
Date
Msg-id imq2bn$akn$1@news.albasani.net
Whole thread Raw
In response to Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4  (Chris Wareham <cwareham@visitlondon.com>)
Responses Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
List pgsql-jdbc
Chris Wareham wrote:
> Dave Cramer wrote:
>> Ok, looking at the hibernate source this is what is in the PostgreSQLDialect
>>
>> public String getIdentitySelectString(String table, String column, int type) {
>>   return new StringBuffer().append("select currval('")
>>     .append(table)
>>     .append('_')
>>     .append(column)
>>     .append("_seq')")
>>     .toString();
>>   }
>> }

> Just as an aside, should that not be using a StringBuilder rather than
> a StringBuffer? Or does Hibernate still explicitly support Java 1.4?

My Red-Flag-O-Meter triggered on that, too.  What Hibernate ought to do is:

  return "select currval('" + table + '_' + column + "_seq')";

for Pete's sake.

I'm off to check if EclipseLink or OpenJPA is better written.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
Next
From: Dave Cramer
Date:
Subject: Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4