-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Simple query syntax error
PostPosted: Thu Sep 08, 2011 9:55 am 
Newbie

Joined: Sun Jun 12, 2011 1:43 pm
Posts: 10
Thise are the lines
Code:
Query q = getSession().createQuery("from "+getGenericClassName()+" as c in (:subList)");
      q.setParameterList("subList", subList);

this is the stack trace
Code:
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: in near line 1, column 30 [from app.persist.DBBook as c in (:subList)]
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
   at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
   at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
   at app.dao.ResultPager.nextPage(ResultPager.java:28)
   at app.BooksBean.getNext(BooksBean.java:41)
   at app.BooksBean.changeSize(BooksBean.java:53)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
   at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
   at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
   at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:144)
   ... 23 more


Top
 Profile  
 
 Post subject: Re: Simple query syntax error
PostPosted: Fri Sep 09, 2011 2:19 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
You are missing the WHERE part: ... as c WHERE c in ....


Top
 Profile  
 
 Post subject: Re: Simple query syntax error
PostPosted: Fri Sep 09, 2011 6:23 am 
Newbie

Joined: Sun Jun 12, 2011 1:43 pm
Posts: 10
Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.