JPA and PostqreSQL: long string persistence

Posted by emanemos on Stack Overflow See other posts from Stack Overflow or by emanemos
Published on 2009-12-09T00:46:25Z Indexed on 2010/05/31 10:02 UTC
Read the original article Hit count: 280

Filed under:
|

Can anybody tell me how to persist long text using JPA (I use PostgreSQL)?

Here's the way I defined a very long string in my class:

@Lob
private String  body;

However, this produces a field of type charactervarying(255) in the database.

Furthermore, I've tried to use @Column annotation:

@Column(columnDefinition="TEXT")
private String  body;

But everything in vain.

I would be gratefull for a helpfull comment on this problem.

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about jpa