Text Field using Hibernate Annotation

You said “I checked the mysql schema and it remains varchar(255)” – did you expect Hibernate to automatically alter your database? It won’t. Even if you have hibernate.hbm2ddl.auto set, I don’t believe Hibernate would alter the existing column definition.

If you were to generate new database creation script, @Lob should generate “TEXT” type column if you don’t specify length explicitly (or if you do and it’s less that 65536). You can always force that by explicitly declaring type in @Column annotation, though keep in mind that’s not portable between databases:

@Column(name="DESC", columnDefinition="TEXT")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)