title: MappingException: No Dialect mapping for JDBC type: 2002
body: <p>I try to query PostgreSQL database via Hibernate native sql interface. But I'm getting <code>org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002</code> </p>
  
  <p>SQL query is quite complex, but via (e.g.) pgAdmin works fine. Does anyone have any idea where the problem should be?</p>
  
  <p><strong>WebpageDaoImpl.java</strong></p>
  
  <pre><code>    public PageDto search(final String term, final Long parentNodeId, final String localeCode){
          hqlQuery =  sessionFactory.getCurrentSession().createSQLQuery(buildSearchQuery(false));                 
          hqlQuery.setCacheable(false);
          hqlQuery.setString("locale", localeCode);
          hqlQuery.setString("query", term);
          hqlQuery.setString("fullTextQuery", term.replace(" ", "&amp;"));
          hqlQuery.setLong("nodeId", parentNodeId);
          items.setItems(hqlQuery.list());
      }
  
    private String buildSearchQuery(){
      StringBuilder sql = new StringBuilder();
      sql.append("with recursive tmp_webpage(id, parent) as ( ")
     .append("    values(cast(-1 as bigint), cast(:nodeId as bigint)) ")
     .append(" union all ")
     .append("    select w.id, w.parent_id ")
     .append("    from tmp_webpage as tw, webpage as w ")
     .append("    where w.id = parent ")
     .append(" ) ")
     .append("SELECT w FROM webpage w ")
     .append("    inner join webpage_content wc ON w.id=wc.webpage_id ")
     .append("WHERE wc.localized_key= :locale AND w.enabled=true (")
     .append("    unaccent(lower(wc.title)) like CONCAT('%', unaccent(lower(:query)) , '%') OR ")
     .append("    wc.webpage_tsvector @@ to_tsquery( cast( wc.localized_key as regconfig), :fullTextQuery) ) ");
     .append("GROUP BY w.id, wc.webpage_tsvector, wc.localized_key ")
     .append("ORDER BY ts_rank(wc.webpage_tsvector, to_tsquery(cast( wc.localized_key as regconfig), :fullTextQuery )) DESC");
     return sql.toString();
  }
  </code></pre>
  
  <p><strong>Webpage.java</strong>        </p>
  
  <pre><code>public class Webpage{
  
      private Long id;
      private Webpage parent;
      private Set&lt;Webpage&gt; childrens;
      // ...
  
      @ElementCollection
      @CollectionTable(name = "webpage_content")
      @MapKeyJoinColumn(name = "locale")
      private Map&lt;String, WebpageContent&gt; localized;
  
      //...
  }
  </code></pre>
  
  <p><strong>WebpageContent.java</strong></p>
  
  <pre><code>@Embeddable
  public class WebpageContent {
  
      private String name;
      private String title;
      private String description;
      private String content;
      //...
  }
  </code></pre>
  
  <p>Note: Table <code>webpage</code> has one more explicit created column <code>webpage_tsvector</code>, wherein is saved fulltext vector.  </p>