I'm getting a NullPointerException from PathExpressionParser when trying to issue the following HQL query:
"select o.id, o.name, o.phones[0].areaCode, o.phones[0].exchange from Individual o where o.source = 'foo' order by o.name, o.phones[0].areaCode, o.phones[0].exchange"
I'm guessing that this is happening because Hibernate doesn't understand how to follow the collection references in the order by clause. Is that correct? If so, are there any plans to support this? If not, any idea what I might be doing wrong? Thanks.
Hibernate version: 2.1.5
Full stack trace of any exception that occurs:
net.sf.hibernate.QueryException: Incorrect query syntax [select o.id, o.name, o.phones[0].areaCode, o.phones[0].exchange from com....Individual o where o.source = 'foo' order by o.name, o.phones[0].areaCode, o.phones[0].exchange]
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:166)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:294)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1562)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1533)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1521)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1513)
at
... 5 more
Caused by: java.lang.NullPointerException
at net.sf.hibernate.hql.PathExpressionParser.getWhereColumn(PathExpressionParser.java:375)
at net.sf.hibernate.hql.OrderByParser.token(OrderByParser.java:31)
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)
... 13 more
Name and version of the database you are using: Oracle 9
|