[HQL] jointure implicite dans un sous-select
Bonjour,
je viens vers vous pour un problème de requête HQL qui ne veut pas fonctionner.
Le problème est le suivant :
l'objet FICHE contient un set de ActionsDeResolutionDesFiche qui lui meme contient une Action.
Je veux réaliser une requête qui me renvoie 3 choses :
- La fiche répondant à tout un tas de critère : ça c'est fait
- Le nombre d'actions associées à cette fiche : ça c'est fait
- Le nombre d'actions ouvertes associées à cette fiche : ça j'y arrive pas :oops:
voici mon code actuel :
Code:
1 2 3 4 5
| select f, f.actionDeResolutionDesFicheEDs.size as actions,
(select f.actionDeResolutionDesFicheEDs.size as actionsEnCours
from f join f.actionDeResolutionDesFicheEDs actionResolution where actionResolution.action.datefermeture is null)
from FicheED f join fetch f.utilisateurED join fetch
f.evenementED join fetch f.bureauED //+critères.. |
le mapping semble correct (j'utilise la console HQL pour tester mes requêtes)
mais j'arrive à l'erreur suivante :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| org.hibernate.exception.SQLGrammarException: could not execute query
(...)
Caused by: java.sql.SQLException: ORA-00904: "ACTIONED7_"."DATFERMETURE" : identificateur non valide
at oracle.jdbc.driver.DatabaseError.throwSqlException(Unknown Source)
at oracle.jdbc.driver.T4CTTIoer.processError(Unknown Source)
at oracle.jdbc.driver.T4CTTIoer.processError(Unknown Source)
at oracle.jdbc.driver.T4C8Oall.receive(Unknown Source)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(Unknown Source)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(Unknown Source)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(Unknown Source)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(Unknown Source)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(Unknown Source)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(Unknown Source)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(Unknown Source)
at org.hibernate.loader.Loader.getResultSet(Unknown Source)
at org.hibernate.loader.Loader.doQuery(Unknown Source)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Unknown Source)
... 68 more |
Auriez vous une idée sur la façon de réaliser cette requête s'il vous plait ?
Merci d'avance !