-1

クエリ:

select *
from easquestionsinfo 
where questionname in(select questionname 
                      from easresponseinfo 
                      where isconflict = 'yes')

このクエリは正常に機能し、質問名が isconflict='yes' の質問名のセットを返す内部クエリによって返されたものと等しい場合、テーブル 'easquestioninfo' からレコードを返します。

4

1 に答える 1

1

JPA は、JPQL、SQL、および Criteria をサポートします。

createNativeQuery() を使用して、この SQL を直接実行できます。

JPQL の場合、オブジェクト モデルによって異なります。

Select q fom QuestionInfo q where q.name in (Select r.name from ResponseInfo q2 where r.isConflict = 'yes')

http://en.wikibooks.org/wiki/Java_Persistence/JPQLを参照してください 。

于 2013-05-16T12:57:39.130 に答える