0
のために私はこのクエリはJavaで休止状態で使用することがあります。休止::予期しないトークン:
String hql = "select part.ID,part.PartNumber,part.Name,parttype.Name,partkind.Name,
partdevice.Name,part.Count,STUFF((SELECT ', ' + cabinet.Name FROM Cabinet as
cabinet,Part_Cabinet as part_cabinet WHERE part.ID=part_cabinet.PaId and cabinet.ID =
part_cabinet.CabId FOR XML PATH('')), 1, 1, ''),part.Descript from Part as part,
PartDevice as partdevice,PartKind as partkind,PartType as parttype Where
part.Kind=partkind.ID and part.Type=parttype.ID and part.Device=partdevice.ID";
Query _q = session.createQuery(hql);
しかし、私はエラーを取得する:
unexpected token: FOR
at org.hibernate.hql.internal.antlr.HqlBaseParser.atom(HqlBaseParser.java:3473)
at org.hibernate.hql.internal.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3168)
at org.hibernate.hql.internal.antlr.HqlBaseParser.multiplyExpression(HqlBaseParser.java:3040)
at org.hibernate.hql.internal.antlr.HqlBaseParser.additiveExpression(HqlBaseParser.java:2750)
at org.hibernate.hql.internal.antlr.HqlBaseParser.concatenation(HqlBaseParser.java:568)
at org.hibernate.hql.internal.antlr.HqlBaseParser.relationalExpression(HqlBaseParser.java:2518)
at org.hibernate.hql.internal.antlr.HqlBaseParser.equalityExpression(HqlBaseParser.java:2474)
at org.hibernate.hql.internal.antlr.HqlBaseParser.negatedExpression(HqlBaseParser.java:2343)
at org.hibernate.hql.internal.antlr.HqlBaseParser.logicalAndExpression(HqlBaseParser.java:2269)
at org.hibernate.hql.internal.antlr.HqlBaseParser.logicalOrExpression(HqlBaseParser.java:2224)
at org.hibernate.hql.internal.antlr.HqlBaseParser.expression(HqlBaseParser.java:2010)
at org.hibernate.hql.internal.antlr.HqlBaseParser.logicalExpression(HqlBaseParser.java:1786)
なぜ?