5 Replies Latest reply on Mar 13, 2002 4:27 AM by Erik Turesson

    IN expression in 3.0 beta

    Erik Turesson Novice

      Hello!

      I am using the jboss 3.0 beta 2, ie the latest from CVS.
      I use the default hypersonic database.
      I have EJB-QL questions that looks like bellow:



      <query-method>
      <method-name>findByImage</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql>SELECT DISTINCT OBJECT(a) FROM PublBean AS a, IN(a.images) img WHERE img.id = ?1</ejb-ql>


      Every query passes the parsing but a FinderException is allways thrown.

      If I turn on the DEBUG traces I can see the following errors in the log.

      Am I doing something wrong or is it a bug?

      /Erik


      2002-03-12 20:21:45,333 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.PublBean.findByImage] Executing SQL: SELECT DISTINCT t0_a.id FROM PublBean t0_a, ImageBean t1_img WHERE t1_img.id = ? AND (t0_a.id=t2_a_images_RELATION_TABLE.PublBean AND t1_img.id=t2_a_images_RELATION_TABLE.ImageBean)
      2002-03-12 20:21:45,343 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.PublBean.findByImage] Find failed
      java.sql.SQLException: Column not found: PUBLBEAN in statement [SELECT DISTINCT t0_a.id FROM PublBean t0_a, ImageBean t1_img WHERE t1_img.id = 1 AND (t0_a.id=t2_a_images_RELATION_TABLE.PublBean AND t1_img.id=t2_a_images_RELATION_TABLE.ImageBean)]
      at org.hsqldb.Trace.getError(Trace.java:180)
      at org.hsqldb.Result.(Result.java:175)
      at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
      at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
      at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:686)
      at org.hsqldb.jdbcStatement.executeQuery(jdbcStatement.java:68)
      at org.hsqldb.jdbcPreparedStatement.executeQuery(jdbcPreparedStatement.java:133)
      at org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery(PreparedStatementInPool.java:862)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:107)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:396)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:320)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:581)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1059)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:222)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:468)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:243)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invoke(BaseLocalContainerInvoker.java:367)
      at $Proxy41.findByImage(Unknown Source)
      at com.proventek.publ.image.implementation.ImageCollectionBean.deleteImage(ImageCollectionBean.java:426)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:642)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:308)
      at org.jboss.ejb.Container.invoke(Container.java:681)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
      at $Proxy38.deleteImage(Unknown Source)
      at org.apache.jsp.afix_0005fimages$jsp._jspService(afix_0005fimages$jsp.java:321)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:326)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:572)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1356)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1309)
      at org.mortbay.http.HttpServer.service(HttpServer.java:744)
      at org.jboss.jetty.Jetty.service(Jetty.java:540)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:743)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:916)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:758)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:145)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
      at java.lang.Thread.run(Thread.java:484)
      2002-03-12 20:21:45,353 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.ArticleBean.findByImage] Executing SQL: SELECT DISTINCT t0_a.id FROM ArticleBean t0_a, ImageBean t1_img WHERE t1_img.id = ? AND (t0_a.id=t2_a_images_RELATION_TABLE.ArticleBean AND t1_img.id=t2_a_images_RELATION_TABLE.ImageBean)
      2002-03-12 20:21:45,353 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.ArticleBean.findByImage] Find failed
      java.sql.SQLException: Column not found: ARTICLEBEAN in statement [SELECT DISTINCT t0_a.id FROM ArticleBean t0_a, ImageBean t1_img WHERE t1_img.id = 1 AND (t0_a.id=t2_a_images_RELATION_TABLE.ArticleBean AND t1_img.id=t2_a_images_RELATION_TABLE.ImageBean)]
      at org.hsqldb.Trace.getError(Trace.java:180)
      at org.hsqldb.Result.(Result.java:175)
      at org.hsqldb.jdbcConnection.executeHSQL(jdbcConnection.java:907)
      at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:718)
      at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:686)
      at org.hsqldb.jdbcStatement.executeQuery(jdbcStatement.java:68)
      at org.hsqldb.jdbcPreparedStatement.executeQuery(jdbcPreparedStatement.java:133)
      at org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.executeQuery(PreparedStatementInPool.java:862)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:107)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:396)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:320)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:581)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1059)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:222)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:134)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:109)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:468)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:243)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invoke(BaseLocalContainerInvoker.java:367)
      at $Proxy30.findByImage(Unknown Source)
      at com.proventek.publ.image.implementation.ImageCollectionBean.deleteImage(ImageCollectionBean.java:443)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:642)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:308)
      at org.jboss.ejb.Container.invoke(Container.java:681)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
      at $Proxy38.deleteImage(Unknown Source)
      at org.apache.jsp.afix_0005fimages$jsp._jspService(afix_0005fimages$jsp.java:321)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:326)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:572)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1356)
      at org.mortbay.http.HttpContext.handle(HttpContext.java:1309)
      at org.mortbay.http.HttpServer.service(HttpServer.java:744)
      at org.jboss.jetty.Jetty.service(Jetty.java:540)
      at org.mortbay.http.HttpConnection.service(HttpConnection.java:743)
      at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:916)
      at org.mortbay.http.HttpConnection.handle(HttpConnection.java:758)
      at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:145)
      at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:287)
      at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:715)
      at java.lang.Thread.run(Thread.java:484)