I have a String in my Entity
@Column(length=40000)
@Lob
private String introText;
The column in my MySQL database that Hibernate creates for introText is a varchar(255), which doesn’t jive with the column length or @Lob annotation. Any ideas? I’m relatively new to Hibernate, so I wonder if I’m missing any other settings or configurations.
After doing the following
In script, i see
So it does not work as expected. So my advice is: use columnDefinition attribute instead
Now it works fine! You can test if you want
Just an advice: if possible, put annotation configuration in getter method instead of member field. Hibernate uses Proxies to do your job. And it works fine when using annotation configuration in getter method.
regards,