Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 8D6941337B49 for ; Mon, 28 Mar 2011 10:53:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 52991-10 for ; Mon, 28 Mar 2011 13:52:52 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id C1B89133616B for ; Mon, 28 Mar 2011 10:52:52 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id p2SDqqUM038532 for ; Mon, 28 Mar 2011 10:52:52 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id p2SDRJ7d062446 for pgsql-jdbc@postgresql.org; Mon, 28 Mar 2011 10:27:19 -0300 (ADT) (envelope-from news) From: Lew X-Newsgroups: pgsql.interfaces.jdbc Subject: Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4 Date: Mon, 28 Mar 2011 09:27:22 -0400 Organization: albasani.net Lines: 29 Message-ID: References: <1300923357612-4259788.post@n5.nabble.com> <1301299364557-4267176.post@n5.nabble.com> <4D905F65.4030207@visitlondon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: news.albasani.net; logging-data="Cgy5Ax5mn+RHiD1t2sC0lz66MBcUjFf3MvPd3eQozp/0ToIKIb1Js/9EyuiWlfSOJ+eDCNYL7BkZLyZztcQ1uIY3ATUrHAPu4/vrjwkE9ZMZP0i3gxXnK7Nq/c05Ah/D"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: <4D905F65.4030207@visitlondon.com> Cancel-Lock: sha1:Li7Dp3CyagN3avDDlmsAJcHdoSU= To: pgsql-jdbc@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/93 X-Sequence-Number: 21648 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