-->
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: Identity left outer join
PostPosted: Fri Mar 14, 2008 11:26 am 
Newbie

Joined: Fri Mar 14, 2008 11:04 am
Posts: 3
Hello,

I´m using JPA and i can´t translate this SQL query in to HQL


select
atleta.Nome as nome,
graduacao1.data as dataInsc,
tipogradua.nome as grad
from
judo.Atletas atleta,
judo.TiposGraduacoes tipogradua,
judo.Graduacoes graduacao
left join judo.Graduacoes graduacao1
on (graduacao.indice_atleta=graduacao1.indice_atleta and graduacao1.id_tipo_graduacao=1)

where
graduacao.indice_atleta=atleta.indice_atleta
and graduacao.id_tipo_graduacao=tipogradua.id_tipo_graduacao
and graduacao.id_doc=145


The problem is that i can´t make an left join from a entity Graduacoes to an Entity Graduacoes.

Help is appreciated

Thanks in advance
Nuno Silva


Top
 Profile  
 
 Post subject: Re: Identity left outer join
PostPosted: Fri Mar 14, 2008 12:00 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
I don't think you can do an outer join if the entities are not related in their mappings. You might have to break this into two queries.



Farzad-


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.