1

JPA(トッ​​プリンク)を使用していて、JPQLクエリによって返される行数を制限しようとしているので、Query.setMaxResultsメソッドを使用しましたが、次のエラーがスローされます。

Exception [TOPLINK-6121] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.QueryException
Exception Description: The query has not been defined correctly, the expression builder is missing.  For sub and parallel queries ensure the queries builder is always on the left.

クエリは次のとおりです。

select distinct d.deptName from Departement d join d.employees e where e.empId in (select distinct a.employee.empId from ApprovedEmpls a join a.NewEmps o)
4

1 に答える 1

1

maxResultsがないと、クエリは同じように失敗すると思いますか?

副選択の問題のようです。削除または変更してみてください(なぜNewEmpsに参加し、まったく使用しないのですか?)。回避策として、ネイティブSQLクエリを使用することもできます。

TopLink EssentialsをEclipseLink(TopLink 11g)にアップグレードすることを検討する必要があります。

于 2010-12-08T13:59:02.277 に答える