によって私は休止状態のためにHQLで書かれたクエリを次のようしています。HQL注文クエリ与える問題
============================================== ==========================
select new map(ret.retailerDesc as ret_name, ret.id.retailerId as ret_id,
ret.id.serviceId as service_id,
(select count(distinct i.inspectionId) as inspections from Inspection i
inner join i.clgCodeStatus c
inner join c.retailerOrderses r
inner join r.cusRetailer cr
inner join i.inspectionMission m where ret.id = cr.id ) as inspections ,
(select count(distinct i.inspectionId) as inspections from Inspection i
inner join i.clgCodeStatus c
inner join c.retailerOrderses r
inner join r.cusRetailer cr
inner join i.inspectionMission m
where ret.id = cr.id and i.inspectionResult = '1' ) as match,
(select count(distinct i.inspectionId) as inspections from Inspection i
inner join i.clgCodeStatus c
inner join c.retailerOrderses r
inner join r.cusRetailer cr
inner join i.inspectionMission m
where ret.id = cr.id and i.inspectionResult = '0' ) as mismatch )
from CusRetailer ret order by inspections desc
================= ==========================================
ERROR: column "inspections" does not exist
それは「査察DESCによってオーダー」のため、このエラーを与えている:====クエリ上記
は、それが次のエラーを与える実行します。 削除すると正常に動作します。
誰もがこの問題を解決するために私を助けてくださいことはできますか?
ありがとうございました。
amar4kintu
こんにちは、 あなたは(あなたはHibernateがtrueにshow_sqlプロパティを設定することにより、これを印刷することができます)HibernateはこのHQLクエリの生成SQLを表示することができます。 Hibernateは不平を言っているようなエラーから はそれが見えませんが、あなたのデータベースがあります。 乾杯お返事 –