Hibernate adding top 2 when I call stored procedure
---------------------------------------------------
Key: HHH-4089
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4089
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.0.SP1
Environment: Windows SP, Microsoft SQL Server 2008, Java 6
Reporter: Venod Raveendran
When I am creating a nativeQuery and calling my stored procedure to update some table
Hibernate is add top 2 in between the call
code
Query q = em.createNativeQuery("Rx_ManageCacheData(?,?,?,?,?,?," +
"?,?,?,?,?,?," +
"?,?,?,?,?,?,?," +
"?,?,?,?,?,?," +
"?,?,?) ");
The above sql becomes
Rx_ManageCache top 2Data(
?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?
)
11297 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 156, SQLState:
S0001
11297 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Incorrect syntax near the
keyword 'top'.
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could
not execute query
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:128)
at
com.venodebiz.middletier.rx.data.serviceimpl.RxDataServiceImpl.manageCachData(RxDataServiceImpl.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy18.manageCachData(Unknown Source)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira