org.hibernate.MappingException: No Dialect mapping

2019-07-08 11:28发布

问题:

1) I added custom dialect by extending PostgreSQL9Dialect which does this.registerColumnType(Types.JAVA_OBJECT, "jsonb");

2) public class JSONObjectUserType implements UserType { }

3) property name="xxxx" type="org.JSONObjectUserType" length="1000"

4) I run hibernate native SQL query.

SQLQuery query1 = (SQLQuery) session.createSQLQuery(str.toString());

It is giving No Dialect mapping for JDBC type: 1111. str = "Select state from X"

Postgresql - column state is of type jsonb.