-->
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 join fetch question...
PostPosted: Fri Jun 13, 2008 5:55 am 
Newbie

Joined: Sun Jul 01, 2007 12:15 pm
Posts: 7
Location: Philippines
I have this query:

from CustomerActivitySector cca where cca.customer_id.customer_id=:x left join fetch cca.activity_sector_id


Is there something wrong with the syntax? Why am i having this error?:

Exception in thread "main" org.hibernate.HibernateException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: left near line 1, column 92 [from com.ibm.pli.databeans.CustomerActivitySector cca where cca.customer_id.customer_id=:x left join fetch cca.activity_sector_id left join fetch cca.customer_id]
at com.ibm.pli.DAO.AbstractDAO.handleException(AbstractDAO.java:116)
at com.ibm.pli.DAO.CustomerActivitySectorDAO.find(CustomerActivitySectorDAO.java:115)
at com.ibm.pli.model.test.MyTest.testRetrieval(MyTest.java:38)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 13, 2008 9:08 am 
Regular
Regular

Joined: Thu Dec 22, 2005 7:47 am
Posts: 62
Location: Czech Republic
Code:
from CustomerActivitySector cca
where cca.customer_id.customer_id=:x
left join fetch cca.activity_sector_id


try it this way :)

Code:
from CustomerActivitySector cca
left join fetch cca.activity_sector_id
where cca.customer_id.customer_id=:x


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.