pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lew <noone@lewscanon.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
Date: Mon, 28 Mar 2011 09:27:22 -0400
Message-ID: <imq2bn$akn$1@news.albasani.net> (raw)
In-Reply-To: <4D905F65.4030207@visitlondon.com>
References: <1300923357612-4259788.post@n5.nabble.com>
	<AANLkTi=muHS+5uUaOoc-6EtNoMBWe39kotKxNTSXKqt-@mail.gmail.com>
	<1301299364557-4267176.post@n5.nabble.com>
	<AANLkTindSSqZiZwtPYKFfmBn+VWqCOrq8F+YC6JLb-eF@mail.gmail.com>
	<AANLkTimHhNpk1Nx9kEza7DyffzTLH=P6ja4XM9j0-yCS@mail.gmail.com>
	<4D905F65.4030207@visitlondon.com>

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



view thread (19+ messages)  latest in thread

Message-ID: <imq2bn$akn$1@news.albasani.net>
Permalink:  ../imq2bn$akn$1@news.albasani.net/
Also on:    postgresql.org/message-id/imq2bn$akn$1@news.albasani.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: noone@lewscanon.com
  Subject: Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
  In-Reply-To: <imq2bn$akn$1@news.albasani.net>
  References: <1300923357612-4259788.post@n5.nabble.com> <AANLkTi=muHS+5uUaOoc-6EtNoMBWe39kotKxNTSXKqt-@mail.gmail.com> <1301299364557-4267176.post@n5.nabble.com> <AANLkTindSSqZiZwtPYKFfmBn+VWqCOrq8F+YC6JLb-eF@mail.gmail.com> <AANLkTimHhNpk1Nx9kEza7DyffzTLH=P6ja4XM9j0-yCS@mail.gmail.com> <4D905F65.4030207@visitlondon.com> <imq2bn$akn$1@news.albasani.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox