-->
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.  [ 1 post ] 
Author Message
 Post subject: Unexpected end of subtree
PostPosted: Fri Jul 06, 2007 3:13 am 
Newbie

Joined: Fri Oct 21, 2005 9:27 am
Posts: 13
Version of Hibernate : 3.2.3

Full stack trace of any exception that occurs:
Code:
org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [select new Destination(:op,o) from MMSOperator o where 
o in (select d.requested from Destination d where d.source = :op and (d.status.key = :rejected or d.status.key = :failed)) or o in (select d.source from Destination d where d.requested =  :op and (d.status.key = :rejected or d.status.key = :failed)) or ( o not in (select d.source from Destination d where d.requested = :op ) and o not in (select d.requested from Destination d where d.source = :op )) and o!= :op]
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
   at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
   at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
   at org.hibernate.hql.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:219)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
   at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
   at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
   at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
   at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
   at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
   at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:863)
   at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:367)
   at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedParam(HibernateTemplate.java:861)
   at com.bics.mms.electiontool.dao.spring.hibernate.DestinationDaoImpl.findAllPossibleDestinations(DestinationDaoImpl.java:79)
   at com.bics.mms.electiontool.services.DestinationServiceImpl.getAllPossibleDestinations(DestinationServiceImpl.java:38)
   at com.bics.mms.electiontool.bo.DestinationTest.testAllPossibleDestinations(DestinationTest.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
   at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


Name and version of the database you are using : Oracle 10g

This problem arise with this query :

Code:
"select new Destination(:op,o) " +
                "from MMSOperator o " +
                "where   o in  (select d.requested from Destination d " +
                "               where d.source = :op" +
                "               and (d.status.key = :rejected or d.status.key = :failed)) " +
                "        or o in (select d.source from Destination d " +
                "                 where d.requested =  :op" +
                "                 and (d.status.key = :rejected or d.status.key = :failed)) " +
                "        or ( o not in  (select d.source from Destination d where d.requested = :op ) " +
                "        and o not in (select d.requested from Destination d where d.source = :op )) " +
                "        and o!= :op";


I can assure you that the variables are well bounded (:op, :rejected and :failed) to the query because when you delete the creation of Destination, that is when you remove "new Destination(:op,o)", it works well !

Am I doing the creation of the Destination object the wrong way ?


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

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.