문제

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();

나에게는 괜찮아 보이지만 결과는입니다

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)

왜요? 뭐가 문제 야?

도움이 되었습니까?

해결책

"GS"별칭을 정의하지 않았습니다. "AGS"와 "TGS"만 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top