-->
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.  [ 2 posts ] 
Author Message
 Post subject: left outer join problem with SQLServer2000
PostPosted: Fri Nov 18, 2005 8:07 am 
Newbie

Joined: Fri Nov 18, 2005 6:57 am
Posts: 2
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.


Top
 Profile  
 
 Post subject: Re: left outer join problem with SQLServer2000
PostPosted: Fri Nov 18, 2005 8:25 am 
Newbie

Joined: Fri Nov 18, 2005 6:57 am
Posts: 2
spirion wrote:
I dont use hibernate assciation between Item and OrderDetail.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.