title: org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002
body: <p>I'm getting <code>org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002</code> when I try to do a JPA nativeQuery to get a geometry field type.</p>
  
  <p>I'm using Oracle and <code>org.hibernatespatial.oracle.OracleSpatial10gDialect</code>.</p>
  
  <p>The geometry field is mapped as:</p>
  
  <pre><code>@Column(name="geometry")  
  @Type(type = "org.hibernatespatial.GeometryUserType")  
  private Geometry geometry;
  
  // ...
  
  List&lt;Object&gt; listFeatures = new LinkedList&lt;Object&gt;();
  
  Query query = entityManager.createNativeQuery(
     "SELECT "+ slots +" , geometry FROM  edtem_features feature, edtem_dades dada WHERE" +
     " feature."+ tematic.getIdGeomField() +" = dada."+ tematic.getIdDataField()+ 
     " AND dada.capesid= "+ tematic.getCapa().getId() +
     " AND feature.geometriesid= "+ tematic.getGeometria().getId());
  listFeatures.addAll(query.getResultList());
  </code></pre>
  
  <p>This is my hibernate configuration over spring+struts2</p>
  
  <pre><code>&lt;bean id="entityManagerFactory"
              class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  
      &lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;
              &lt;property name="databasePlatform" value="org.hibernatespatial.oracle.OracleSpatial10gDialect" /&gt;
              &lt;property name="showSql" value="true" /&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
      &lt;property name="jpaProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernatespatial.oracle.OracleSpatial10gDialect&lt;/prop&gt;
              &lt;prop key="hibernate.default_schema"&gt;my_schema&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>How can this be solved? Or how to force the type of the geometry to get this working?</p>