I just downloaded Hibernate 3.3.0 GA, installed it as library within my JBoss application and tried.
Sadly, it immediately throws an exception at application startup, when it does the schema validation.
Code:
org.hibernate.HibernateException: Wrong column type in dpjw.assessment for column NOTES. Found: text, expected: longtext
Comparing the sources I can see that someone set two java statements into comment. The 3.2 version of MySQLDialect.java looks like this:
Code:
protected void registerVarcharTypes() {
registerColumnType( Types.VARCHAR, "longtext" );
registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
registerColumnType( Types.VARCHAR, 65535, "text" );
registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
}
while the new 3.3.0 version is this:
Code:
protected void registerVarcharTypes() {
registerColumnType( Types.VARCHAR, "longtext" );
// registerColumnType( Types.VARCHAR, 16777215, "mediumtext" );
// registerColumnType( Types.VARCHAR, 65535, "text" );
registerColumnType( Types.VARCHAR, 255, "varchar($l)" );
}
Can anyone of the committers explain why this was done? I effectively have some attributes in my tables where I want to save some text strings. I annotated the attributes with a maximum string length of 512 bytes and the former schema exporter correctly declared this attribute as
Code:
NOTES text,
So, what of this?