Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 189551337BC4 for ; Tue, 8 Feb 2011 23:51:06 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 46900-06 for ; Wed, 9 Feb 2011 03:51:00 +0000 (UTC) Received: from news.hub.org (news.hub.org [200.46.204.72]) by mail.postgresql.org (Postfix) with ESMTP id 618C61337BCD for ; Tue, 8 Feb 2011 23:50:58 -0400 (AST) 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 p193ovfw089798 for ; Tue, 8 Feb 2011 23:50:57 -0400 (AST) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id p193N5nc039367 for pgsql-jdbc@postgresql.org; Tue, 8 Feb 2011 23:23:05 -0400 (AST) (envelope-from news) From: Lew X-Newsgroups: pgsql.interfaces.jdbc Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob Date: Tue, 08 Feb 2011 22:23:29 -0500 Organization: albasani.net Lines: 37 Message-ID: References: <4D511C79.4010507@opencloud.com> <23828143.70.1297164859086.JavaMail.on@prod2> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit In-Reply-To: <23828143.70.1297164859086.JavaMail.on@prod2> Cancel-Lock: sha1:Y95eLWuDWk+Yd1b3bxlB0skxVmU= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 Injection-Info: news.albasani.net; logging-data="ZmikJzsUjyKsowvsodJB5k+ow+P+uZnrVXYr/dAxeeZo5hKlFJEo69olNMLwC3syk6fkwftaUkQDhWrWnxRoMCbzqSmV5svtkU59pC212p1YcX9/s82P70XOmgiHlQE0"; mail-complaints-to="abuse@albasani.net" 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: 201102/51 X-Sequence-Number: 21449 Andreas Joseph Krogh wrote: > I get around this problem in Hibernate by using this combination: > > @Column(name="my_name") > @Lob > @Type(type="org.hibernate.type.StringClobType") > > ...but the StringClobType is deprecated. > It really makes it so much easier to have a TEXT column mapped to a 'String'. @Entity public class Foo { @Id private String ident; private String somethingBackedByTEXT; ... } FWIW, in a database like Oracle that does have CLOBs it's still a lot easier with Hibernate to map CLOBs to 'String' than to 'Clob', as I learned from experience. Even the Hibernate documentation recommends against mapping to 'Clob'. -- Lew Ceci n'est pas une fenĂȘtre. .___________. |###] | [###| |##/ | *\##| |#/ * | \#| |#----|----#| || | * || |o * | o| |_____|_____| |===========|