i'm using spring 4, postgresql , eclipselink.
i build query db, passing 2 parameters. i'm having these troubles :
call: select n.id, n.volume, n.numero numberentity n n.volume = :volume , n.numero = :numero query: readallquery(referenceclass=numberentity sql="select n.id, n.volume, n.numero numberentity n n.volume = :volume , n.numero = :numero")] root cause org.postgresql.util.psqlexception: errore: errore di sintassi o presso ":" posizione: 70 @ org.postgresql.core.v3.queryexecutorimpl.receiveerrorresponse(queryexecutorimpl.java:2103) @ org.postgresql.core.v3.queryexecutorimpl.processresults(queryexecutorimpl.java:1836) @ org.postgresql.core.v3.queryexecutorimpl.execute(queryexecutorimpl.java:257) @ org.postgresql.jdbc2.abstractjdbc2statement.execute(abstractjdbc2statement.java:512) @ org.postgresql.jdbc2.abstractjdbc2statement.executewithflags(abstractjdbc2statement.java:388) @ org.postgresql.jdbc2.abstractjdbc2statement.executequery(abstractjdbc2statement.java:273) @ org.eclipse.persistence.internal.databaseaccess.databaseaccessor.executeselect(databaseaccessor.java:1009) @ org.eclipse.persistence.internal.databaseaccess.databaseaccessor.basicexecutecall(databaseaccessor.java:644) @ org.eclipse.persistence.internal.databaseaccess.databaseaccessor.executecall(databaseaccessor.java:560) @ org.eclipse.persistence.internal.sessions.abstractsession.basicexecutecall(abstractsession.java:2056) @ org.eclipse.persistence.sessions.server.clientsession.executecall(clientsession.java:306) @ org.eclipse.persistence.internal.queries.datasourcecallquerymechanism.executecall(datasourcecallquerymechanism.java:242) @ org.eclipse.persistence.internal.queries.datasourcecallquerymechanism.executecall(datasourcecallquerymechanism.java:228) @ org.eclipse.persistence.internal.queries.datasourcecallquerymechanism.executeselectcall(datasourcecallquerymechanism.java:299) @ org.eclipse.persistence.internal.queries.datasourcecallquerymechanism.selectallrows(datasourcecallquerymechanism.java:694) @ org.eclipse.persistence.queries.readallquery.executeobjectlevelreadquery(readallquery.java:559) @ org.eclipse.persistence.queries.objectlevelreadquery.executedatabasequery(objectlevelreadquery.java:1175) @ org.eclipse.persistence.queries.databasequery.execute(databasequery.java:904) @ org.eclipse.persistence.queries.objectlevelreadquery.execute(objectlevelreadquery.java:1134) @ org.eclipse.persistence.queries.readallquery.execute(readallquery.java:460) @ org.eclipse.persistence.queries.objectlevelreadquery.executeinunitofwork(objectlevelreadquery.java:1222) @ org.eclipse.persistence.internal.sessions.unitofworkimpl.internalexecutequery(unitofworkimpl.java:2896) @ org.eclipse.persistence.internal.sessions.abstractsession.executequery(abstractsession.java:1857) @ org.eclipse.persistence.internal.sessions.abstractsession.executequery(abstractsession.java:1839) @ org.eclipse.persistence.internal.sessions.abstractsession.executequery(abstractsession.java:1804) @ org.eclipse.persistence.internal.jpa.queryimpl.executereadquery(queryimpl.java:258) @ org.eclipse.persistence.internal.jpa.queryimpl.getresultlist(queryimpl.java:473) @ org.springframework.data.jpa.repository.query.jpaqueryexecution$collectionexecution.doexecute(jpaqueryexecution.java:121) @ org.springframework.data.jpa.repository.query.jpaqueryexecution.execute(jpaqueryexecution.java:85) @ org.springframework.data.jpa.repository.query.abstractjpaquery.doexecute(abstractjpaquery.java:116) @ org.springframework.data.jpa.repository.query.abstractjpaquery.execute(abstractjpaquery.java:106) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.doinvoke(repositoryfactorysupport.java:483) @ org.springframework.data.repository.core.support.repositoryfactorysupport$queryexecutormethodinterceptor.invoke(repositoryfactorysupport.java:461) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.data.projection.defaultmethodinvokingmethodinterceptor.invoke(defaultmethodinvokingmethodinterceptor.java:61) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.transaction.interceptor.transactioninterceptor$1.proceedwithinvocation(transactioninterceptor.java:99) @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:282) @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:96) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.dao.support.persistenceexceptiontranslationinterceptor.invoke(persistenceexceptiontranslationinterceptor.java:136) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.data.jpa.repository.support.crudmethodmetadatapostprocessor$crudmethodmetadatapopulatingmethodinterceptor.invoke(crudmethodmetadatapostprocessor.java:133) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.interceptor.exposeinvocationinterceptor.invoke(exposeinvocationinterceptor.java:92) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.data.repository.core.support.surroundingtransactiondetectormethodinterceptor.invoke(surroundingtransactiondetectormethodinterceptor.java:57) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:213) @ com.sun.proxy.$proxy43.getbyvolumeandnumero(unknown source) @ spring.data.readdb.readdata(readdb.java:27) @ spring.data.readdb$$fastclassbyspringcglib$$a343f117.invoke(<generated>) @ org.springframework.cglib.proxy.methodproxy.invoke(methodproxy.java:204) @ org.springframework.aop.framework.cglibaopproxy$cglibmethodinvocation.invokejoinpoint(cglibaopproxy.java:721) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:157) @ org.springframework.transaction.interceptor.transactioninterceptor$1.proceedwithinvocation(transactioninterceptor.java:99) @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:282) @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:96) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.cglibaopproxy$dynamicadvisedinterceptor.intercept(cglibaopproxy.java:656) @ spring.data.readdb$$enhancerbyspringcglib$$c09581d8.readdata(<generated>) @ spring.service.serviceimpl.readnewspaper(serviceimpl.java:30) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.springframework.aop.support.aoputils.invokejoinpointusingreflection(aoputils.java:333) @ org.springframework.aop.framework.reflectivemethodinvocation.invokejoinpoint(reflectivemethodinvocation.java:190) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:157) @ org.springframework.transaction.interceptor.transactioninterceptor$1.proceedwithinvocation(transactioninterceptor.java:99) @ org.springframework.transaction.interceptor.transactionaspectsupport.invokewithintransaction(transactionaspectsupport.java:282) @ org.springframework.transaction.interceptor.transactioninterceptor.invoke(transactioninterceptor.java:96) @ org.springframework.aop.framework.reflectivemethodinvocation.proceed(reflectivemethodinvocation.java:179) @ org.springframework.aop.framework.jdkdynamicaopproxy.invoke(jdkdynamicaopproxy.java:213) @ com.sun.proxy.$proxy47.readnewspaper(unknown source) @ spring.controller.dispatcherweb.readarticlenewspaper(dispatcherweb.java:36) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.springframework.web.method.support.invocablehandlermethod.doinvoke(invocablehandlermethod.java:205) @ org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:133) @ org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:116) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlermethod(requestmappinghandleradapter.java:827) @ org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:738) @ org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:85) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:963) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:897) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:970) @ org.springframework.web.servlet.frameworkservlet.dopost(frameworkservlet.java:872) @ javax.servlet.http.httpservlet.service(httpservlet.java:661) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:846) @ javax.servlet.http.httpservlet.service(httpservlet.java:742) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:231) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:166) @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:52) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:193) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:166) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:198) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:96) @ org.apache.catalina.authenticator.authenticatorbase.invoke(authenticatorbase.java:478) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:140) @ org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:80) @ org.apache.catalina.valves.abstractaccesslogvalve.invoke(abstractaccesslogvalve.java:624) @ org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:87) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:342) @ org.apache.coyote.http11.http11processor.service(http11processor.java:799) @ org.apache.coyote.abstractprocessorlight.process(abstractprocessorlight.java:66) @ org.apache.coyote.abstractprotocol$connectionhandler.process(abstractprotocol.java:861) @ org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(nioendpoint.java:1455) @ org.apache.tomcat.util.net.socketprocessorbase.run(socketprocessorbase.java:49) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run(taskthread.java:61) @ java.lang.thread.run(unknown source)
and piece of code this:
@query(value = "select n.id, n.volume, n.numero numberentity n n.volume = :volume , n.numero = :numero", nativequery = true) public list<numberentity> getbyvolumeandnumero(@param("volume") string volume, @param("numero") string numero);
can me ? is correct pass parameter @query using ':' ? thank !
Comments
Post a Comment