I am trying to execute the following querry and getting a weird exception that I dont understand. Can anyone give me a hand?
The query is:
Code:
select issue from SubscriptionIssue issue
where issue.subscription.ID = :subscriptionID
and issue.issueNumber > :lastIssue
This query says "net.sf.hibernate.QueryException: in expected: issue [select issue from SubscriptionIssue issue where issue.subscription.ID = :subscriptionID and issue.issueNumber > :lastIssue]"
The full exception is:
Code:
java.lang.RuntimeException: net.sf.hibernate.QueryException: in expected: issue [select issue from SubscriptionIssue issue where issue.subscription.ID = :subscriptionID and issue.issueNumber > :lastIssue]
at com.bmw.candy.candiedServices.SubscriptionAccess.fetchNewIssues(SubscriptionAccess.java:308)
at com.bmw.candy.candiedServices.tags.FetchNewIssuesTag.doTag(FetchNewIssuesTag.java:41)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx._jspx_meth_cs_fetchNewIssues_0(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:388)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx._jspx_meth_c_forEach_0(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:300)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx.access$2(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:271)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx$UpdatedSubscriptions_jspxHelper.invoke0(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:460)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx$UpdatedSubscriptions_jspxHelper.invoke(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:477)
at org.apache.jsp.tag.web.menu_tag.doTag(org.apache.jsp.tag.web.menu_tag:117)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx._jspx_meth_site_menu_0(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:225)
at org.apache.jsp.JSPs.UpdatedSubscriptions_jspx._jspService(org.apache.jsp.JSPs.UpdatedSubscriptions_jspx:90)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: net.sf.hibernate.QueryException: in expected: issue [select issue from SubscriptionIssue issue where issue.subscription.ID = :subscriptionID and issue.issueNumber > :lastIssue]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:295)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1571)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1542)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.bmw.candy.candiedServices.SubscriptionAccess.fetchNewIssues(SubscriptionAccess.java:303)
... 29 more
Hibernate version: Current Production
Mapping documents:Code:
<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping schema="CandiedServices"
package="com.bmw.candy.candiedServices.data">
<class name="Subscription" table="SUBSCRIPTION">
<id name="ID" type="long" unsaved-value="null" column="ID">
<generator class="native" />
</id>
<property name="name" length="16" not-null="true" unique="true"/>
<property name="description" length="256" not-null="true" />
<set name="issues" sort="natural" table="SUBSCRIPTION_ISSUES" lazy="true">
<key column="_issueID" />
<composite-element class="SubscriptionIssue">
<property name="issueNumber" not-null="true" unique="true"/>
<property name="issueURL" length="512" not-null="true"/>
<many-to-one name="subscription"/>
</composite-element>
</set>
</class>
<class name="Subscriber" table="SUBSCRIBER" lazy="true">
<id name="ID" type="long" unsaved-value="null" column="ID">
<generator class="native" />
</id>
<property name="username" length="15" not-null="true" unique="true"/>
<property name="password" length="30" not-null="true" />
<property name="familyName" length="30" not-null="true" />
<property name="givenName" length="30" not-null="true" />
<set name="subscriptions" sort="natural" table="SUBSCRIBER_SUBSCRIPTIONS">
<key column="_statusID" />
<composite-element class="SubscriptionStatus">
<property name="lastIssue" not-null="true"/>
<many-to-one name="subscription" not-null="true"/>
<many-to-one name="subscriber" not-null="true"/>
</composite-element>
</set>
</class>
</hibernate-mapping>