Search code examples
javamysqlspringhibernatehsqldb

string data, right truncation - Hibernate with Spring Boot


So I've got an entity class working perfectly. Today I added a new field:

ButtonTargetBehavior buttonTargetBehavior;

ButtonTargetBehavior is an interface (which implements Serializable). Whenever I try to run my spring boot app now I get this

string data, right truncation 

error which refers to that field (Yes, I actually save an instance of a class that implements the interface, for example:

public class RandomButtonTargetBehavior implements ButtonTargetBehavior

).

I use HSQLDB for testing and MySQL on production. What do I need to do?


Solution

  • Fixed by Storing Objects in columns using Hibernate JPA. I think the most proper solution is custom types though.