Quelqu'un peut il me dire comment fonctionne la fonction exists en HQL.
j'utilise une requête dont certains paramêtres ne sont pas définis.
par exemple :
select distinct u from Utilisateur u, ActionDiffusionBE a
where a.acId =788 and
( u.utId = 20
or u.utId = 19
or u.utId = 17
or u.roles.roId in (5,7,8)

or (u.roles.roId =2 and u.roles.roId in (select rl.roId from Utilisateur chef inner join chef.roles rl where chef.utId=20 and rl.roNiv=2))
)
me retourne 4 enregitrements

select ut from Utilisateur ut where ut.usine.usId = 16 and ut.roles.roId =11

me retourne 2 enregistrements mais si j'utilise la requête suivante

select distinct u from Utilisateur u, ActionDiffusionBE a
where a.acId =788 and
( u.utId = 20
or u.utId = 19
or u.utId = 17
or u.roles.roId in (5,7,8)
or exists (select ut from Utilisateur ut where ut.usine.usId = 16 and ut.roles.roId =11)
or (u.roles.roId =2 and u.roles.roId in (select rl.roId from Utilisateur chef inner join chef.roles rl where chef.utId=20 and rl.roNiv=2))
) ,
la requête me retourne 13 enregistrements.
Est ce un bug d'hibernate ou une mauvaise utilisation ?