Re: ResultSet.getClob() causing problems when used with JPA's @Lob - Mailing list pgsql-jdbc

From Lew
Subject Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date
Msg-id iit1ap$hqk$1@news.albasani.net
Whole thread Raw
In response to Re: ResultSet.getClob() causing problems when used with JPA's @Lob  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: ResultSet.getClob() causing problems when used with JPA's @Lob
List pgsql-jdbc
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|
|_____|_____|
|===========|

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Next
From: Andreas Joseph Krogh
Date:
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob