Longvarchar in Hibernate
I used @Type (org.hibernate.annotations.Type;) and it worked:
`addresses` text CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL
@Column(columnDefinition = "text")
@Type(type = "text")
private String addresses;
You can either modify the database:
ALTER TABLE product MODIFY description VARCHAR(255);
This simple ALTER TABLE
command may fail if the description values are longer than 255 characters, so you may need to do it by creating a new column and transforming the values and dropping the original column.
Or you can adjust the Java code:
@Lob
@Column(name = "description", columnDefinition = "LONGTEXT")
private String description;
You can try to omit the columnDefinition
first, it may be the default MySQL text LOB for Hibernate.