This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!