-->
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.  [ 3 posts ] 
Author Message
 Post subject: QuerySyntaxException, can't find it
PostPosted: Mon Jun 28, 2010 10:58 am 
Newbie

Joined: Tue Sep 15, 2009 5:25 am
Posts: 8
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1, column 84 [select b from de.taf.easygo.modules.timetable.hafas.Bahnhof as b join BfKoord as k on b.nummer = k.bahnhof_nummer where (k.x >= 10.993004838908002 and k.x <= 11.006995161091998 and k.y >= 49.9955035971223 and k.y <= 50.0044964028777) order by b.name]

Could anybody pls tell me what exactly causes this exception? =(

Many thanx!


Top
 Profile  
 
 Post subject: Re: QuerySyntaxException, can't find it
PostPosted: Mon Jun 28, 2010 11:06 am 
Beginner
Beginner

Joined: Thu Feb 08, 2007 10:40 am
Posts: 46
The exception is caused by the
Code:
on b.nummer = k.bahnhof_nummer
part. Hibernate knows from the mapping which columns to join - so you must not add this to your query. This is also what the error message says:
Code:
unexpected token: on
                  ^^


Top
 Profile  
 
 Post subject: Re: QuerySyntaxException, can't find it
PostPosted: Fri Jul 02, 2010 5:59 am 
Newbie

Joined: Tue Sep 15, 2009 5:25 am
Posts: 8
Thank you very much. I needed to join b.koord for it to work. But one question remains. Do I _always_ need a forward association, (cos I created it for that)? Is it possible to join BfKoord on BfKoord.bahnhof, the other direction?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.