Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi at all,

I'm having a issue trying to get working a JPA nativeQuery.
I'm having a org.hibernate.MappingException: No Dialect mapping for JDBC type: 2002 when a try to do a nativeQuery and get a geometry field type.
I use oracle and org.hibernatespatial.oracle.OracleSpatial10gDialect.

The geom fields is mapped as:




Anybody knows a solution? or how to force the type of the geometry to get wroking this...


MANY Thanks in advance.
Moli
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the complete stack with the error? Post also the complete code of the query execution...

Thnx
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the JDBC documentation, 2002 is a struct data type. The error message tells you the dialect does not support this. You could try upgrading your dialect, or swap the data type to something it can support.
 
Moli molina
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your replies.

I using the dialect that match to my database. I don't know is there's a best dialect, I will check it.

Now I'm using another query, and using a @SqlResultSetMapping and returning a two whole objects. (dades, features)....No only some fields. Usign this now is working...Not is the best solution but it' works.

I don't undestand how works the dialect, but it's strange that cannot use a nativeQuery with a user defined type (org.hibernatespatial.GeometryUserType) by the dialect.

Well now is working using this:






Many thanks
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic