2009-06-18 5 views
46
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(); 

"노드에 대한 어떤 데이터 유형은"나에게 잘 보이는,하지만 결과는 이 HQL의 문제점은 무엇입니까?

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) 

입니까? 뭐가 문제 야?

답변

76

"gs"별칭을 정의하지 않았습니다. 당신은 "ags"와 "tgs"만 있습니다.

-1

이 오류가 표시되면 단어 또는 변수 사이에 오타 또는 공백이 없음을 알아야합니다.

관련 문제