views:

25

answers:

2

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;
}
+1  A: 

Try this:

@Column(name = "STACKTRACE")
@Type(type="text")
Maurice Perry
+1  A: 

The reverse engineering Hibernate Tools, makes from MySql Type text:

@Column(name = "COLUMNNAME", length = 65535)
Alex
Indeed. If you look at the `MySqlDialect`, you'll see that it uses the length to derive the type.
Pascal Thivent