I want my hibernate support Mysql Text type. But i get the error:
org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:370)
I search by google, I find this method is valid.
{codecitation class=" java; gutter: true;"}
package ceapet.jbpm;
import org.hibernate.Hibernate;
import org.hibernate.dialect.MySQLInnoDBDialect;
import java.sql.Types;
public class ExtMySQLInnoDBDialect extends MySQLInnoDBDialect {
public ExtMySQLInnoDBDialect()
{
super();
registerHibernateType(-1,Hibernate.TEXT.getName());
}
}
{/codecitation}
Than modify hibernate.xml
org.hibernate.dialect.MySQLInnoDBDialect
to
ceapet.jbpm.ExtMySQLInnoDBDialect