I am using scripts to generate tables instead of hibernate auto generate. There is a varchar column with length 5000
create table my_code (
cc_id bigint not null auto_increment unique,
description varchar(5000),
primary key (cc_id)
) ENGINE=InnoDB
In my class i have a description field:
@Column(name = "description", length=5000)
private String description;
But when i insert a field with length 300 it throws:
Data truncation: Data too long for column 'description' at row 1
It accepts anything below 255 which is the default. Why is it not picking up length 5000?