-->
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.  [ 1 post ] 
Author Message
 Post subject: No Dialect mapping for JDBC type: -1
PostPosted: Tue May 01, 2007 5:11 am 
Newbie

Joined: Tue Apr 24, 2007 9:31 am
Posts: 2
I am getting the following error while executing a EJB3 native query on MySQL 5. The query execute fine against the database.

Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
at org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
at org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
at org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:231)
at org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:559)
at org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:485)
at org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:501)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1677)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
... 161 more


I am not trying to map the result to any entity I just call
em.createNativeQuery(sql).getResultList();

SQL


Code:
Select d.filename, d.docid, d.status, d.visibilityId, d.type,d.createdBy, d.createdDate, d.fileTypeId, users, groups,  di.index1,di.index2,di.index3 FROM Document d left  join (SELECT docid, MAX( if (document_index.name='index1',document_index.value,'')) as index1, MAX( if (document_index.name='index2',document_index.value,'')) as index2, MAX( if (document_index.name='index3',document_index.value,'')) as index3 FROM document_index GROUP BY docid) as di   on di.docid = d.docid  left join ( SELECT docid, group_concat(user.name) as users FROM  document_allocation da inner join user on user.userid = da.userid  where da.current = 1 group by da.docid) as us  on us.docid = d.docid left join  ( SELECT docid, group_concat(g.name) as groups from document_allocation  da inner join groups g on g.groupId = da.groupId group by da.docid) as groups on groups.docid = d.docid


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

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.