2 Replies Latest reply on Dec 15, 2006 2:24 PM by gizdek

    Exception Caused by: org.hibernate.QueryException: could not

    gizdek

      Inside my project i'm trying to do a cross join like:

      assignedGroupsList = em.createQuery("select g.name from Groups as g, User2SecondaryGroup as s where s.gid = g.uid and s.uid = :userid").setParameter("userid", this.user.getUid()).getResultList();

      and what i'm getting is an exception i can not resolve... maybe someone here can help me out... thanks do far - as i am a newbie , maybe there is a type mapping or something else needed

      something like that works fine for example..

      groupsList = em.createQuery("from Groups where " + "lower(name) like :search").setParameter("search", searchString).setHint("org.hibernate.cacheable", true).getResultList();

      ...
      sorcecode:
      ---------------------------------------------------------
      User2SecondaryGroup:
      ---------------------------------------------------------

      package src;

      import java.io.Serializable;

      import javax.persistence.Entity;
      import javax.persistence.GeneratedValue;
      import javax.persistence.Id;
      import javax.persistence.Table;

      import org.hibernate.validator.Length;
      import org.hibernate.validator.NotNull;
      import org.hibernate.validator.Pattern;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;

      import static org.jboss.seam.ScopeType.SESSION;

      /**
      * @author ls006
      * @version 1.0
      * user2secondarygroup entity instance corresponds a row of user2secondarygroup table
      */

      @Entity
      @Table(name="user2secondarygroup")
      @Name("user2secondarygroup")
      @Scope (SESSION)
      public class User2SecondaryGroup implements Serializable {

      private Integer uid;
      private Integer gid;

      public User2SecondaryGroup() {
      uid = null;
      gid = null;
      }


      @Id @NotNull
      public Integer getUid() {
      return uid;
      }

      public void setUid(Integer uid) {
      this.uid = uid;
      }


      @Id @NotNull
      public Integer getGid() {
      return gid;
      }

      public void setGid(Integer gid) {
      this.gid = gid;
      }


      @Override
      public boolean equals(Object other) {
      if (other == null || !(other instanceof User2SecondaryGroup)) {
      return false;
      }
      User2SecondaryGroup otherUser2SecondaryGroup = (User2SecondaryGroup) other;
      return (this.getUid().equals(otherUser2SecondaryGroup.getUid()) && this.getGid().equals(otherUser2SecondaryGroup.getUid()));
      }


      public String toString() {
      return "User2SecondaryGroup (" + getUid().toString() + " " + getGid().toString() + " )";
      }
      }





      18:01:24,346 ERROR [STDERR] javax.persistence.PersistenceException: org.hibernate.QueryException: could not resolve property: gid of: src.User2SecondaryGroup [select g.name from src.Groups as g, src.User2SecondaryGroup as s where s.gid = g.uid and s.uid = :userid]
      18:01:24,346 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:567)
      18:01:24,346 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:79)
      18:01:24,346 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManager.createQuery(TransactionScopedEntityManager.java:127)
      18:01:24,346 ERROR [STDERR] at src.User2SecondaryGroupManagerAction.loadUser2SecondaryGroupList(User2SecondaryGroupManagerAction.java:64)
      18:01:24,346 ERROR [STDERR] at src.User2SecondaryGroupManagerAction.openSecondaryGroupAssignView(User2SecondaryGroupManagerAction.java:154)
      18:01:24,346 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      18:01:24,346 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      18:01:24,346 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,346 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,346 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      18:01:24,346 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
      18:01:24,346 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor196.invoke(Unknown Source)
      18:01:24,346 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,346 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:79)
      18:01:24,346 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)
      18:01:24,346 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,346 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,346 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
      18:01:24,356 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor194.invoke(Unknown Source)
      18:01:24,356 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,356 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
      18:01:24,356 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor193.invoke(Unknown Source)
      18:01:24,356 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,356 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
      18:01:24,356 ERROR [STDERR] at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
      18:01:24,356 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor192.invoke(Unknown Source)
      18:01:24,356 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,356 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,356 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
      18:01:24,356 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      18:01:24,356 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,356 ERROR [STDERR] at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
      18:01:24,356 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,356 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      18:01:24,356 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,356 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      18:01:24,356 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,356 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      18:01:24,356 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
      18:01:24,356 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,356 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      18:01:24,356 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,366 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
      18:01:24,366 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,366 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      18:01:24,366 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,366 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      18:01:24,366 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,366 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      18:01:24,366 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      18:01:24,366 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
      18:01:24,366 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
      18:01:24,366 ERROR [STDERR] at $Proxy104.openSecondaryGroupAssignView(Unknown Source)
      18:01:24,366 ERROR [STDERR] at src.User2SecondaryGroupManager$$FastClassByCGLIB$$625cb2a5.invoke()
      18:01:24,366 ERROR [STDERR] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
      18:01:24,466 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
      18:01:24,466 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,466 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:38)
      18:01:24,466 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor164.invoke(Unknown Source)
      18:01:24,466 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,466 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:30)
      18:01:24,466 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor163.invoke(Unknown Source)
      18:01:24,466 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,466 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78)
      18:01:24,466 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
      18:01:24,466 ERROR [STDERR] at src.User2SecondaryGroupManager$$EnhancerByCGLIB$$7ad38e5b.openSecondaryGroupAssignView()
      18:01:24,466 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      18:01:24,466 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      18:01:24,466 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      18:01:24,466 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      18:01:24,466 ERROR [STDERR] at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
      18:01:24,466 ERROR [STDERR] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
      18:01:24,466 ERROR [STDERR] at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
      18:01:24,466 ERROR [STDERR] at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
      18:01:24,466 ERROR [STDERR] at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
      18:01:24,466 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:106)
      18:01:24,466 ERROR [STDERR] at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
      18:01:24,466 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
      18:01:24,466 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
      18:01:24,466 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
      18:01:24,466 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      18:01:24,466 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      18:01:24,466 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      18:01:24,466 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      18:01:24,466 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      18:01:24,466 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      18:01:24,466 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      18:01:24,466 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      18:01:24,466 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      18:01:24,466 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
      18:01:24,466 ERROR [STDERR] Caused by: org.hibernate.QueryException: could not resolve property: gid of: src.User2SecondaryGroup [select g.name from src.Groups as g, src.User2SecondaryGroup as s where s.gid = g.uid and s.uid = :userid]
      18:01:24,466 ERROR [STDERR] at org.hibernate.persister.entity.AbstractPropertyMapping.throwPropertyException(AbstractPropertyMapping.java:43)
      18:01:24,466 ERROR [STDERR] at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:37)
      18:01:24,466 ERROR [STDERR] at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1302)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:280)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:373)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:539)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:221)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:172)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:737)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1215)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4032)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3518)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1758)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1683)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:227)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:159)
      18:01:24,476 ERROR [STDERR] at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:110)
      18:01:24,476 ERROR [STDERR] at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
      18:01:24,476 ERROR [STDERR] at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
      18:01:24,476 ERROR [STDERR] at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
      18:01:24,476 ERROR [STDERR] at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
      18:01:24,476 ERROR [STDERR] at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
      18:01:24,476 ERROR [STDERR] at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1612)
      18:01:24,476 ERROR [STDERR] at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:76)
      18:01:24,476 ERROR [STDERR] ... 136 more



      thanks a lot...

        • 1. Exception Caused by: org.hibernate.QueryException: could not
          gizdek

           

          "Gizdek" wrote:
          Inside my project i'm trying to do a cross join like:

          assignedGroupsList = em.createQuery("select g.name from Groups as g, User2SecondaryGroup as s where s.gid = g.gid and s.uid = :userid").setParameter("userid", this.user.getUid()).getResultList();

          I've made a mistake in my post , above you see the right quary i'm using and i am getting the shown exception.


          • 2. Re: Exception Caused by: org.hibernate.QueryException: could
            gizdek

            I solved the problem, removing the second @Id (gid) annotation inside the User2SecondaryGroup class fixed the problem.

            now it looks like

            private Integer uid;
            private Integer gid;

            public User2SecondaryGroup() {
            }

            @Id
            @NotNull
            public Integer getUid() {
            return uid;
            }

            public void setUid(Integer uid) {
            this.uid = uid;
            }


            @NotNull
            public Integer getGid() {
            return gid;
            }

            public void setGid(Integer gid) {
            this.gid = gid;
            }


            @Override
            public boolean equals(Object other) {
            if (other == null || !(other instanceof User2SecondaryGroup)) {
            return false;
            }
            User2SecondaryGroup otherUser2SecondaryGroup = (User2SecondaryGroup) other;
            return (this.getUid().equals(otherUser2SecondaryGroup.getUid()) && this.getGid().equals(otherUser2SecondaryGroup.getUid()));
            }


            public String toDebugString() {
            return "User2SecondaryGroup (" + getUid().toString() + " " + getGid().toString() + " )";
            }
            }