Posts

Showing posts from March, 2016

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