-->
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.  [ 4 posts ] 
Author Message
 Post subject: HQL: left join with arbitrary Entity
PostPosted: Fri Sep 28, 2007 8:43 am 
Newbie

Joined: Thu Feb 22, 2007 5:42 pm
Posts: 2
hi,

in tutorials i find only left joins betweet Entities which are already connected
(from Cat as cat left join cat.mate.kittens as kittens)

is it possible to join arbitrary Entities?
from A a left join B b on a.x = b.y

_________________
Hansa wird Meister.


Top
 Profile  
 
 Post subject: Same problem
PostPosted: Wed Nov 28, 2007 10:29 am 
Newbie

Joined: Mon Jun 26, 2006 4:38 am
Posts: 7
Location: Osijek, Croatia
is this possible
from A a left join B b on a.x = b.y


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 6:48 am 
Newbie

Joined: Mon Dec 03, 2007 6:40 am
Posts: 1
Hi,


For me the following does not work:

select a from A as a left join B as b on a.x = b.x

I get an exception like :

org.hibernate.hql.ast.QuerySyntaxError: unexpected token: on near line 1, column (whatever column is "on" on)

Any ideas or clues would be highly regarded.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 7:31 am 
Newbie

Joined: Mon Jun 26, 2006 4:38 am
Posts: 7
Location: Osijek, Croatia
Quote:
select a from A as a left join B as b on a.x = b.x

That is clasical sql.
In hql it would be something like this:
Select a1 from A a1 outer left join a1.b as b1

but my idea was to join tables which are only linked in database but not in models mapped by hibernate which is not possible at least not easily possible .
but I've decided to change my approach so I do not have that problem any more.

Kruno.


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