Oracle org.hibernate.MappingException: No Dialect mapping for JDBC type: -9

I started receiving this message when some one changed the column type in Oracle from varchar2 to nvarchar2. The dialect I’m using is “org.hibernate.dialect.Oracle10gDialect”. Switching it back to varchar2 fixed the problem.

Digging further into Hibernate source code, I found an alternate approach. That would be to create a custom dialect. This solution takes 5 minutes. Here is the source code for custom dialect:


public class CustomeOracleDialect extends Oracle10gDialect
{
public CustomeOracleDialect()
{
registerHibernateType( Types.NVARCHAR, Hibernate.STRING.getName() );
}

}