Bonjour à tous,

J'utilise Hibernate 3.3.2 et j'ai une erreur que je ne comprends pas du tout sur une requête HQL.
Ma requête va chercher des authorizations, selon certaines critères.

Voici la requête qui plante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
SELECT A FROM Authorization A where A.lastVersion = true 
and UPPER(A.authorizationLbl) LIKE :label 
and A.authoStatusType.authoStatusCode <> :statusInProgress 
and A.authoStatusType.authoStatusCode <> :statusDeleted 
and A.authorizationId in (
   select autho.authorizationId from Authorization autho 
   left outer join autho.facility as faci 
   left outer join faci.deal as dea 
   left outer join dea.confidentialityLevel as conf 
   where faci is null or conf != :confLevel 
) 
order by A.authorizationCode
L'erreur que j'ai à l'exécution de la requête est :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
java.lang.NullPointerException
    at org.hibernate.hql.ast.tree.FromClause.findIntendedAliasedFromElementBasedOnCrazyJPARequirements(FromClause.java:120)
Là où je ne comprends pas, c'est que si je vire la requête imbriquée, alors ça passe.
Si je la laisse mais que je vire le 2e test sur l'authoStatusCode, ça passe.
Si je remplace mes deux tests authoStatusCode par un not in, ça passe.

Autrement dit, les requêtes suivantes vont passer :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
SELECT A FROM Authorization A where A.lastVersion = true and UPPER(A.authorizationLbl) LIKE :label and A.authoStatusType.authoStatusCode <> :statusInProgress and A.authoStatusType.authoStatusCode <> :statusDeleted order by A.authorizationCode
Code : Sélectionner tout - Visualiser dans une fenêtre à part
SELECT A FROM Authorization A where A.lastVersion = true and UPPER(A.authorizationLbl) LIKE :label and A.authoStatusType.authoStatusCode <> :statusDeleted and A.authorizationId in (select autho.authorizationId from Authorization autho left outer join autho.facility as faci left outer join faci.deal as dea left outer join dea.confidentialityLevel as conf where faci is null or conf != :confLevel ) order by A.authorizationCode
Code : Sélectionner tout - Visualiser dans une fenêtre à part
SELECT A FROM Authorization A where A.lastVersion = true and UPPER(A.authorizationLbl) LIKE :label and A.authoStatusType.authoStatusCode not in(:statusInProgress, :statusDeleted) and A.authorizationId in (select autho.authorizationId from Authorization autho left outer join autho.facility as faci left outer join faci.deal as dea left outer join dea.confidentialityLevel as conf where faci is null or conf != :confLevel ) order by A.authorizationCode
Où est mon erreur ?

Merci d'avance, là, je sèche vraiment...