2 Replies Latest reply on Mar 8, 2005 12:50 PM by Bill Burke

    Error in using Inner Join

    shiraz memon Newbie

      Hi all,

      I was trying to use INNER JOIN and faced the following error

      Exception in thread "main" org.hibernate.QueryException: outer or full join must be followed by path expression [SELECT ep.eProdId,ip.iProdId, ep.eProdNumber,ip.iProdNumber, ep.eProdName,ip.iProdName, ep.eProdDesc,ip.iProdDesc,ip.iProdSurfaceStruct,c.custId, c.custName FROM mes.ejb.entity.InternalProduct ip INNER JOIN ExternalProduct ep ON (ip.iProdId = ep.iProdId) INNER JOIN Customer c ON (ep.custId = c.custId)]
       at org.hibernate.hql.classic.FromParser.token(FromParser.java:170)
       at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:86)
       at org.hibernate.hql.classic.PreprocessingParser.token(PreprocessingParser.java:108)
       at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:29)
       at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:172)
       at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:148)
       at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:412)
       at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:987)
       at org.hibernate.impl.SessionImpl.find(SessionImpl.java:964)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
       at org.jboss.ejb3.entity.QueryImpl.getResultList(QueryImpl.java:52)
       at mes.ejb.session.ProdManagerBean.getEProdForList(ProdManagerBean.java:285)
       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:585)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:77)
       at org.jboss.aspects.tx.TxSupport.invokeInOurTx(TxSupport.java:141)
       at org.jboss.aspects.tx.TxSupport$Required.serverInvoke(TxSupport.java:438)
       at org.jboss.aspects.tx.TxInterceptor.internalInvoke(TxInterceptor.java:112)
       at org.jboss.aspects.tx.TxInterceptor.invoke(TxInterceptor.java:60)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:66)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:66)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:36)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:66)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:66)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:148)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:102)
       at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:74)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:295)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:169)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:259)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:308)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:141)
      


      Another question: Is it possible to use Database Views? if yes than could you please paste a short sample in reply to this message.

      Thanks alot in advance

      Yours