问题描述
当这段代码:
SimpleDateFormat = new SimpleDateFormat(yyyy-MM-dd HH:mm:ss);
List< Object []> objects = entityManager.createNativeQuery(select ERROR_CODE,REASON,
count(*)+ //
from flow_error+ //
where timestamp+ //
to_date(:endDate,'YYYY-MM-DD HH24:MI:SS')+ //
and to_date(:startDate,'YYYY-MM-DD HH24:MI:SS')+ //
AND TRANSACTION_UUID in(+ //
SELECT TRANSACTION_UUID+ //
FROM RJT_HIST+ //
where insert_tst+ // $ b $:endDate,'YYYY-MM-DD HH24:MI:SS')+ //
和to_date(:startDate,'YYYY-MM-DD HH24:MI:SS')之间的$ b + //
和flow_number =:flowNumber) + //
GROUP BY ERROR_CODE,原因 )//
.setParameter( 结束日期,sdfDatetime.format(结束日期) )//
.setParameter(startDate,sdfDatetime.format(startDate))//
.setParameter(flowNumber,flowNumber)//
.getResultList();
用于tomcat服务器v5.5,代码运行良好,不会返回任何异常。
但问题出现在weblogic服务器(v10.3.6)上。
我从hibernate得到一个Mapping异常:
2014-06-17 17:57:02,727 [ ACTIVE] ExecuteThread: '6' 的队列: 'weblogic.kernel.Default
(自调谐)'] ERROR com.btoc.reporting.web.misc.MiscServletFilter - 错误处理请求
org.springframework.web.util.NestedServletException:请求处理失败;嵌套异常是javax.persistence.PersistenceException:org.hibernate.MappingException:否JDBC类型方言映射:-9
。在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)$ b $在javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
在javax.servlet。 http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper $ ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(在weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
(在weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
)
$ weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:526)$ b $ weblogic.servlet.intern al.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
处org.tuckey.web.filters org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
。 urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
位于org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
位于org.tuckey.web.filters。在weblogic.servlet.internal.FilterChainImpl上
。的doFilter(FilterChainImpl.java:56)
在com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:65)
在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java: 56)在org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147
)
。在org.springframework.web.filter.OncePerRequestFil ter.doFilter(OncePerRequestFilter.java:76)
在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter( FilterChainProxy.java:311)
处org.springframework.security.web.access.intercept org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
。 FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)维持在org.springframework.security.web.access org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
。 ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)维持在org.springframework.security.web.session org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
。 SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
a t org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
at org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(Reques tCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter( AbstractAuthenticationProcessingFilter.java:182)
处org.springframework.security.web.authentication.logout.LogoutFilter org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
。的doFilter(LogoutFilter.java:105)维持在org.springframework.security.web.context.SecurityContextPersistenceFilter org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
。的doFilter(SecurityContextPersistenceFilter.java:87)
在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)
在org.springframework.security.web.FilterChainProxy.doFilter( FilterChainProxy.java:173)
。在org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
在org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
。在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
在org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
在org.springframework.web。 filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal( CharacterEncodingFilter.java:88)在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56
)
at com.btoc.reporting.web.misc.MiscServletFilter.doFilterInternal(MiscSe rvletFilter.java:25)在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56
)
at weblogic.servlet.internal.WebAppServletContext $ ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
at weblogic.servlet.internal.WebAppServletContext $ ServletInvocationAction.run(WebAppServletContext.java:3696)
在weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal .WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java :1490)
在weblogic.work.ExecuteThread.execute(ExecuteThread.ja va:256)
在weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
引起:javax.persistence.PersistenceException:org.hibernate.MappingException:否JDBC类型的方言映射: - 9
。在在org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
。在COM。 btoc.reporting.web.monit.service.RejectionServiceImpl.retrieveErrorFromIntervalAndFlow(RejectionServiceImpl.java:178)
在com.btoc.reporting.web.monit.RecordedDashboardController.getErrors(RecordedDashboardController.java:45)
。在sun.reflect.NativeMethodAccessorImpl.invoke0(本地方法)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.m在org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
处org.springframework.web提供了ethod.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
。 servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java :80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
在org .springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
... 64 more
引起:org.hibernate.MappingException:否JDBC类型的Dialect映射:-9
。在org.hibernate.dialect.TypeNames.get(TypeNames.java:56)
在org.hibernate.dialect.TypeNames.get(TypeNames.java:81)
在org.hibernate.dialect .Dialect.getHibernateTypeName(Dialect.java:370)
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:1796)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
在org.hibernate.loader.Loader.do列表(Loader.java:2213)
在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)
。在组织.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
在org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
在org.hibernate.ejb.QueryImpl.getResultList (QueryImpl.java:65)
... 79 more
我无法弄清楚为什么。
任何猜测?
感谢提前。
最后解决方案的确如
我正在寻找在错误的方言..这是SQLServer和我使用Oracle10gDialect。
所以我创建了这个类:
public class Oracle10gDialectOverrider扩展了Oracle10gDialect {
public Oracle10gDialectOverrider(){
super();
registerHibernateType(Types.NVARCHAR,Hibernate.STRING.getName());
}
}
并指定到我的hibernate xml中: Oracle10gDialectOverrider代替Oracle10gDialect
谢谢
I'm having a trouble with a native SQL query...
When this code :
SimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
List<Object[]> objects = entityManager.createNativeQuery(" select ERROR_CODE, REASON,
count(*) " + //
" from flow_error " + //
"where timestamp " + //
" between to_date(:endDate,'YYYY-MM-DD HH24:MI:SS') " + //
" and to_date(:startDate,'YYYY-MM-DD HH24:MI:SS') " + //
" AND TRANSACTION_UUID in ( " + //
" SELECT TRANSACTION_UUID " + //
" FROM RJT_HIST " + //
" WHERE insert_tst " + //
" between to_date(:endDate,'YYYY-MM-DD HH24:MI:SS') " + //
" and to_date(:startDate,'YYYY-MM-DD HH24:MI:SS') " + //
" and flow_number = :flowNumber) " + //
" GROUP BY ERROR_CODE, REASON")//
.setParameter("endDate", sdfDatetime.format(endDate))//
.setParameter("startDate", sdfDatetime.format(startDate))//
.setParameter("flowNumber", flowNumber)//
.getResultList();
is used on a tomcat server v5.5, the code works well and dont return any exception.But the problem appears on a weblogic server (v10.3.6).I'm getting an Mapping exception from hibernate :
2014-06-17 17:57:02,727 [[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default
(self-tuning)'] ERROR com.btoc.reporting.web.misc.MiscServletFilter - Error processing request
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:526)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:65)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:147)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:139)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at com.btoc.reporting.web.misc.MiscServletFilter.doFilterInternal(MiscServletFilter.java:25)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:74)
at com.btoc.reporting.web.monit.service.RejectionServiceImpl.retrieveErrorFromIntervalAndFlow(RejectionServiceImpl.java:178)
at com.btoc.reporting.web.monit.RecordedDashboardController.getErrors(RecordedDashboardController.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
... 64 more
Caused by: org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
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:370)
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:1796)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
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:152)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:65)
... 79 more
I cant figure out why.
Any guess ?
Thanks by advance.
Finally the solution was indeed like org.hibernate.MappingException :No Dialect mapping for JDBC type: -9
I was looking at the wrong dialect.. This was for SQLServer and i'm using Oracle10gDialect.So i've made this class :
public class Oracle10gDialectOverrider extends Oracle10gDialect{
public Oracle10gDialectOverrider(){
super();
registerHibernateType(Types.NVARCHAR, Hibernate.STRING.getName());
}
}
And specify into my hibernate xml : Oracle10gDialectOverrider instead of Oracle10gDialect
Thanks
这篇关于对于JDBC类型,无方言映射:-9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!