0

I have an entity class with a String property that I want to map to a TEXT column. I use java 8, mysql 5.7.18 on ubuntu and hibernate 5.2.6

I used @Column(name='x', columndefinition='text not null') (accordind to this post What properties does @Column columnDefinition make redundant?), after that, I use @Type after @Column according to this post Hibernate Error while persisting TEXT datatype, but always my column created as varchar(255)

are there problem in my code and scenario? or there are any configurations

Alireza
  • 126
  • 1
  • 14

2 Answers2

3

if you want this property mapped as a text into your table use @Lob annotation top level of your property that's define as a String in entity class.

1

a simple OR BIG mistake!

I've used @column annotation before set method, instead of get method

Alireza
  • 126
  • 1
  • 14