JPA and PostqreSQL: long string persistence
- by emanemos
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.