Does anybody know a way to override the method getSqlType(...) in Column class from a Dialect class.
I have implmented a Dialect class for HSQLDB and I have a column defined like this: @Column(columnDefinition = "nvarchar(max)") private String code;
When Hibernate goes through this method it returns nvarchar and this data type is not supported by HSQLDB.
public String getSqlType(Dialect dialect, Mapping mapping) throws HibernateException { return sqlType==null ? dialect.getTypeName( getSqlTypeCode(mapping), getLength(), getPrecision(), getScale() ) : sqlType; }
I can't simply remove the Column annotation because for some tests we are directly accessing a real database using DbUnit and it fails because Hibernate is returning varchar(255) when there is no columnDefinition defined and I get a wrong data type exception.
|