-->
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: 'elements' or 'indices' - Does not generate SQL
PostPosted: Fri Apr 29, 2005 4:52 pm 
Beginner
Beginner

Joined: Mon Mar 08, 2004 5:22 pm
Posts: 35
Can some tell what i am missing in the following HQL:
I have one-to-many relation between CalEvent and LaneDtls classes.
In CalEvent.java and CalEvent.hbm.xml files i have LaneDtls referred with Set. I just want to find out what syntactically i am missing in HQL.
Please help

HQL:
***
FROM CalEvent event left join fetch event.laneDtls
WHERE (event.start_date <= :bindStart AND event.end_date = :bindStart OR event.start_date BETWEEN :bindStart AND :bindEnd)
AND elements(event.laneDtls.sale_type) is not null


EXCEPTION:
**********

org.springframework.orm.hibernate.HibernateQueryException: expecting 'elements' or 'indices' after: id [

FROM com.mycompany.calendarmodel.data.CalEvent event left join fetch event.laneDtls
WHERE (event.start_date <= :bindStart AND event.end_date >= :bindStart OR event.start_date BETWEEN :bindStart AND :bindEnd)
AND elements(event.laneDtls.sale_type) is not null

]; nested exception is net.sf.hibernate.QueryException: expecting 'elements' or 'indices' after: id [

FROM com.mycompany.calendarmodel.data.CalEvent event left join fetch event.laneDtls
WHERE (event.start_date <= :bindStart AND event.end_date >= :bindStart OR event.start_date BETWEEN :bindStart AND :bindEnd)
AND elements(event.laneDtls.sale_type) is not null

]
net.sf.hibernate.QueryException: expecting 'elements' or 'indices' after: id [

FROM com.mycompany.calendarmodel.data.CalEvent event left join fetch event.laneDtls
WHERE (event.start_date <= :bindStart AND event.end_date >= :bindStart OR event.start_date BETWEEN :bindStart AND :bindEnd)
AND elements(event.laneDtls.sale_type) is not null

]
at net.sf.hibernate.collection.CollectionPropertyMapping.toType(CollectionPropertyMapping.java:53)
at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244)
at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283)
at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:321)
at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:329)
at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:366)
at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:251)
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:293)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1530)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.mycompany.calendarmodel.dao.CalendarDAOImpl$1.doInHibernate(CalendarDAOImpl.java:92)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:312)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:289)
at com.mycompany.calendarmodel.dao.CalendarDAOImpl.executeCallBack(CalendarDAOImpl.java:67)
at com.mycompany.calendarmodel.dao.CalendarDAOImpl.getMastercalendar(CalendarDAOImpl.java:28)
at java.lang.reflect.Method.invoke(Native Method)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:284)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:163)
at $Proxy0.getMastercalendar(Unknown Source)
at com.mycompany.calendarmodel.access.CalendarManagerImpl.getMastercalendar(CalendarManagerImpl.java:34)
at com.mycompany.calendarmodel.test.CalendarTest.testCalendarMaster(CalendarTest.java:64)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)


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.