Hibernate MSSQL Server dialect mapping for N* JDBC types

You have to extend the dialect, and register the appropriate Hibernate types for the N* JDBC types, in the constructor.

public class MyDialect extends SomeOfTheProvidedDialects {

    public MyDialect() {
        registerHibernateType(Types.NCHAR, StandardBasicTypes.CHARACTER.getName());
        registerHibernateType(Types.NCHAR, 1, StandardBasicTypes.CHARACTER.getName());
        registerHibernateType(Types.NCHAR, 255, StandardBasicTypes.STRING.getName());
        registerHibernateType(Types.NVARCHAR, StandardBasicTypes.STRING.getName());
        registerHibernateType(Types.LONGNVARCHAR, StandardBasicTypes.TEXT.getName());
        registerHibernateType(Types.NCLOB, StandardBasicTypes.CLOB.getName());
    }
}

Reference : http://stackoverflow.com/questions/27039300/jpa-sql-server-no-dialect-mapping-for-jdbc-type-9

Comments

Popular posts from this blog

PostgreSQL bytea and oid

MySQL as Hive metadata store

Microservices Architecture with Spring Boot in 15mins