Type mapping MySQL type text to Java Hibernate

Alex picture Alex · Jul 5, 2010 · Viewed 44.4k times · Source

What is the correct mapping type from MySQL data type text to Java using Hibernate?

@Column(name = "STACKTRACE", length = Integer.MAX_VALUE)
public String getStacktrace() {
    return this.stacktrace;
}

Answer

Maurice Perry picture Maurice Perry · Jul 5, 2010

Try this:

@Column(name = "STACKTRACE")
@Type(type="text")