0 Replies Latest reply on Mar 23, 2010 6:24 AM by Renand

    ORMExecuteQuery with parameters

    Renand

      Hi all.

       

      I have some problems with ORMExecuteQuery().

      When I try to return a result with :

       

      ORMExecuteQuery("FROM purchase_order WHERE customer_id = 1 AND payment_id ! = 0)

       

      it's perfect. But when I try this others way :

       

      ORMExecuteQuery("FROM purchase_order WHERE customer_id=? AND payment_id !=?",[1, 0])

       

      OR

       

      ORMExecuteQuery("FROM purchase_order WHERE customer_id=:customer_id AND payment_id!=:payment_id",{custome_id=1, payment_id=0})

       

      I found an error.

       

      The system has  attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

      Null Pointers are  another name for undefined values.

       

      The Stack Trace

       

      java.lang.NullPointerException
           at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:329)
           at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:299)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:98)
           at coldfusion.orm.hibernate.HibernatePersistenceManager._executeHQL(HibernatePersistenceManager.java:810)
           at coldfusion.orm.hibernate.HibernatePersistenceManager.executeHQL(HibernatePersistenceManager.java:739)
           at coldfusion.orm.hibernate.HibernatePersistenceManager.executeQuery(HibernatePersistenceManager.java:617)
           at coldfusion.orm.ORMUtils._executeQuery(ORMUtils.java:289)
           at coldfusion.orm.ORMUtils._executeQuery(ORMUtils.java:258)
           at coldfusion.orm.ORMUtils.executeQuery(ORMUtils.java:250)
           at coldfusion.runtime.CFPage.ORMExecuteQuery(CFPage.java:7693)
           at cfmy_orders2ecfm2098615978.runPage(C:\Inetpub\wwwroot\SITES\DECOVENTE\views\customers\my_orders.cfm:40)
           at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
           at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
           at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
           at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:342)
           at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
           at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
           at coldfusion.filter.PathFilter.invoke(PathFilter.java:87)
           at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
           at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
           at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
           at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
           at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
           at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
           at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
           at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:53)
           at coldfusion.CfmServlet.service(CfmServlet.java:200)
           at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
           at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
           at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
           at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
           at jrun.servlet.FilterChain.service(FilterChain.java:101)
           at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
           at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
           at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
           at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
           at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
           at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
           at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
           at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)



           at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

       

       

      Do you have an idea about that ?

       

      Thanks in advance.