I have a problem with left outer join.
I have read the topic on hql and chaged the source code below many times.
but i coulnd find what was the correct hql.
Hibernate version: 2.1.6
Code between sessionFactory.openSession() and session.close():
Code:
hql.append("SELECT i, od FROM Item i ");
hql.append(" JOIN OrderDetail od where i.itemId = od.itemId");
session = getSession();
query = session.createQuery( hql.toString() );
query.list();
Full stack trace of any exception that occurs:
Caused by: net.sf.hibernate.QueryException: outer or full join must be followed by path expression [SELECT i, od FROM com.grandsphere.cosmecom.entity.Item i left JOIN OrderDetail od where i.itemId = od.itemId]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:166)
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:294)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1563)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1534)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
Name and version of the database you are using:Sqlserver2000
thanks in advance.