-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: No Dialect mapping for JDBC type: 7
PostPosted: Wed May 02, 2007 8:04 am 
Newbie

Joined: Thu Feb 09, 2006 12:37 pm
Posts: 18
Hi all,
I am new to hibernate and ORM, I am trying to setup a very simple web application, with a simple to modrately complicated table model.

So far I am asking hibernate to just get all of the rows in one table.

However I get an exception that there is no Dialect Mapping for JDBC type 7 (mySQL)

I have tried both of these mappings:
MySQL org.hibernate.dialect.MySQLDialect
MySQL with InnoDB org.hibernate.dialect.MySQLInnoDBDialect

The cloest error i could find was about a type 3 dialect, which seemed to have been only partial implemented.

Any clues as to why I would get this error?

Hope I have posted correctly by filling out the relivent items below.
also I am using Spring, which seems to be allowed to have the hibernate config values stored in its XML configuration.

G

Hibernate version:3.2.3

Full stack trace of any exception that occurs:
org.hibernate.MappingException: No Dialect mapping for JDBC type: 7
org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:369)
org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:559)
org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:485)
org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:501)
org.hibernate.loader.Loader.getResultSet(Loader.java:1796)
org.hibernate.loader.Loader.doQuery(Loader.java:674)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
org.hibernate.loader.Loader.doList(Loader.java:2220)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
org.hibernate.loader.Loader.list(Loader.java:2099)
org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
com.orange.componentcatalogue.dao.hb.ComponentDaoHb.getComponents(ComponentDaoHb.java:36)
com.orange.componentcatalogue.service.ComponentManager.getComponents(ComponentManager.java:18)
com.orange.componentcatalogue.web.ComponentListController.handleRequest(ComponentListController.java:24)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:819)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:754)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:399)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:354)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Name and version of the database you are using:mySQL 5.0.37

The generated SQL (show_sql=true):select comp.* from (select OID, max(VID) as maxvid from cmt_007_component group by OID) as x inner join cmt_007_component as comp on comp.OID = x.OID and comp.VID = x.maxvid;


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 9:34 am 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Not real familiar with MySQL, but looking at the dialect, it indeed does not implement a type mapping for java.sql.Types.REAL (JDBC type 7). I'm not sure why that is, because REAL is listed in the MySQL JDBC reference. Perhaps someone has more insight, but if they don't, you might want to switch to a DOUBLE or FLOAT.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 9:41 am 
Newbie

Joined: Thu Feb 09, 2006 12:37 pm
Posts: 18
Thanks, I thought I had speced float, as, if i am honest am more comfortable with java types then DB types.

Thanks for teh speedy response. I will give it a go.

G


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 9:53 am 
Newbie

Joined: Thu Feb 09, 2006 12:37 pm
Posts: 18
Yep that works.
I am surprised though, as the data type was a float in both Java and mySQL so I expected it to pick float as the datatype.

Have update the mapping.

Now HQL..... :D

G


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.