Hibernate version: 1.0.1
While a query such as
Code:
SELECT Order.Date,
Order.PoNumber,
OrderStatus.Description
FROM Order AS Order
JOIN LEFT JOIN Order.OrderStatus AS OrderStatus
fails with the (not too surprising) exception
Code:
QueryException: BY expected after GROUP or ORDER: LEFT [FROM MyCompany.Entities.Order AS Order
LEFT JOIN Order.OrderStatus AS OrderStatus]
at NHibernate.Hql.ClauseParser.Token(String token, QueryTranslator q)
at NHibernate.Hql.PreprocessingParser.Token(String token, QueryTranslator q)
at NHibernate.Hql.ParserHelper.Parse(IParser p, String text, String seperators, QueryTranslator q)
at NHibernate.Hql.QueryTranslator.Compile()
at NHibernate.Hql.QueryTranslator.Compile(ISessionFactoryImplementor factory, IDictionary replacements, Boolean scalar)
at NHibernate.Impl.SessionFactoryImpl.GetQuery(String queryString, Boolean shallow)
at NHibernate.Impl.SessionImpl.GetQueries(String query, Boolean scalar)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
at NHibernate.Impl.QueryImpl.List()
the simpler query
Code:
SELECT Order.Date,
Order.PoNumber,
FROM Order AS Order
actually works fine. If reserved HQL keywords like ORDER and GROUP can be used as aliases in the FROM clause, why can't they be used in a JOIN clause?