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

1
  • Can you try this @Column(name="x",columnDefinition = "TEXT") Commented May 27, 2017 at 8:38

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

a simple OR BIG mistake!

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.