session.createQuery("Select attribute from GoodsSection tgs " +
"join gs.ascendants ags join ags.attributes attribute " +
"where attribute.outerId = :outerId and tgs = :section ")
.setString("outerId", pOuterId)
.setEntity("section", section)
.setMaxResults(1)
.uniqueResult();
Ça me va bien, mais le résultat est
Java.lang.IllegalStateException: No data type for node: org.hibernate.hql.ast.tree.IdentNode
\-[IDENT] IdentNode: 'attribute' {originalText=attribute}
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.Java:145)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.Java:705)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.Java:529)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.Java:645)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.Java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.Java:229)
Pourquoi? Qu'est-ce qui ne va pas?
Vous n'avez pas défini l'alias "gs". Vous n'avez que "ags" et "tgs".