• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Moli molina
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
 
Victor Dolirio
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate 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