Same deal.
expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]
org.springframework.orm.hibernate3.HibernateQueryException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:640)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:378)
at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedParam(HibernateTemplate.java:873)
at com.tradecraft.capetown.server.dao.impl.hibernate.CapeTownDao.getLocations(CapeTownDao.java:151)
at com.tradecraft.capetown.server.dao.impl.hibernate.test.GetLocationsTest.testSuccessfulLocationRetrieval(GetLocationsTest.java:71)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
Caused by: org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]
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.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
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:875)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
emsa wrote:
Or just simply use:
Code:
select l from Location l where l.category.code in (:codes)
/Magnus