I write the site and use the embeded db in my case, this is h2 and accordingly hibernate, the problem is that it translates the field with the String type to VARCHAR (255), and I need to store the text in one specific variable of the String type (in the code called content) (chapter content), so what kind of annotation or how can we otherwise indicate that this variable in the database was created with the type TEXT?
entity class code:
import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity public class BlogEntry { @Id @GeneratedValue private Long id; private String title; private String content; private String date; private int numberInBlog; @ManyToOne private Blog blog; public String getTitle() { return title; } public String getDate() { return date; } public int getNumberInBlog() { return numberInBlog; } public void setNumberInBlog(int numberInBlog) { this.numberInBlog = numberInBlog; } public void setDate(String date) { this.date = date; } public void setTitle(String title) { this.title = title; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Blog getBlog() { return blog; } public void setBlog(Blog blog) { this.blog = blog; } public String getContent() { return content; } public void setContent(String content) { this.content = content; }
}