-->
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.  [ 1 post ] 
Author Message
 Post subject: Pb de sql généré
PostPosted: Thu Nov 24, 2005 6:37 am 
Newbie

Joined: Thu Nov 24, 2005 6:25 am
Posts: 1
Bonjour,

Contexte : hibernate 3.0.4, dialecte pgsql (pas testé en 3.0.5 mais le changelog 3.0.4-3.0.5 ne semble pas faire référence au problème ci-dessous).


Si j'exécute la requête suivante :
Code:
select l.employe.id from RapportSocial as r left join r.lignes as l where r.date=:date

tout se passe bien et j'obtiens les résultats escomptés

Si j'exécute cette requête :
Code:
select em.nom from Employe as em where em.id not in (select l.employe.id from RapportSocial as r left join r.lignes as l where r.date=:date)

je n'obtiens plus les bons résultats et, en regardant le log, je m'aperçois que la jointure entre RapportSocial et LigneRapportSocial (via la collection "lignes") est manquante (alors que dans la première requête, le jointure était bel et bien là).

Pour information, voici le code SQL généré par la deuxième requête :
Code:
select employe0_.nom as col_0_0_   
from Employe employe0_
where employe0_.id not in (
    select  lignes2_.employe
    from RapportSocial rapportsoc1_, LigneRapportSocial lignes2_
    where rapportsoc1_.date=?
)


Est-ce moi qui fait quelque chose de travers ?

Merci d'avance,

Christophe Grand


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

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.