我在JPQL中有一个这样的查询:
SELECT ...
FROM Receipt AS receipt
JOIN Invoice AS invoice
ON receipt.invoiceID = invoice.id
LEFT JOIN Payment AS payment
ON receipt.paymentID = payment.id
LEFT JOIN CreditNote AS creditNote
ON receipt.crmID = creditNote.id
LEFT JOIN Profile AS profile
ON invoice.accountID = profile.accountID
WHERE ...
但是,当我使用EclipseLink运行它时,我得到了这个无效的本机查询
SELECT ...
FROM receipts t0
LEFT OUTER JOIN payments t2
ON ( t0.payment_id = t2.id )
LEFT OUTER JOIN credit_notes t3
ON ( t0.crm_id = t3.id )
LEFT OUTER JOIN profile t4
ON ( t1.account_id = t4.account_id ),
bills t1
WHERE ...
如何解决此问题?
1条答案
按热度按时间m2xkgtsf1#
在我的例子中,我能够将所有连接的
JOIN
更改为LEFT JOIN
,然后我的排序得到了尊重。我怀疑根本问题是EclipseLink中的一个bug。