Answer the question
In order to leave comments, you need to log in
Why is a String field with @Lob annotation stored as a number?
Hello )
The problem is that when saving an entity with a field
@Lob
@Column(name = "content")
private String content;
public MyEntity setContent(String content) {
this.content = content;
return this;
}
Answer the question
In order to leave comments, you need to log in
There are two types of LOBs in PostgreSQL - BLOB and CLOB . Judging by the fact that the entity field is of type String, you need the second one. And this needs to be added:
@Lob @Type(type = "org.hibernate.type.TextType")
private String content;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question