hibernate 4.3.11.finalを使用しています。 (括弧が追加周辺)Hibernate:サブ選択クエリでIN句を使用する場合のstangeエラー
select distinct doc from DocumentType doc join doc.usages u where u.institute not in :institutes and doc.id not in (select distinct doc1.id from DocumentType doc1 join doc1.usages u1 where u1.institute in :institutes)
正しく生成された句の最初が、1:
は、我々は、サブ選択クエリを元にで句を使用@query注釈付きリクエストを作りますsubselectではありません。
生成されたSQLは次のとおりです。
select distinct doc from fr.itce.pen.model.customer.folder.DocumentType doc join doc.usages u where u.institute not in (:institutes_0_, :institutes_1_) and doc.id not in (select distinct doc1.id from fr.itce.pen.model.customer.folder.DocumentType doc1 join doc1.usages u1 where u1.institute in :institutes_0_, :institutes_1_)]
仕事は周りとして宣言されたクエリに括弧で一部に囲むようにある:
select distinct doc from DocumentType doc join doc.usages u where u.institute not in :institutes and doc.id not in (select distinct doc1.id from DocumentType doc1 join doc1.usages u1 where u1.institute in (:institutes))
それを動作させるためのより良い方法はあり、最近の休止状態のバージョンで修正されたこの「バグ」ですか?私は休止状態の問題を見ましたが、私はこの動作に関する情報を見つけることができませんでした。
よろしくお願いいたします。
私が噛んでいるように私には見えるhttps://hibernate.atlassian.net/browse/HHH-5126?focusedCommentId=62841&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment- 62841 – Nemesis