我正在尝试将 mysql 代码转换为 JPQL。我有两张桌子。第一个表名为 Product。它有以下字段:id 和 code。第二个表称为描述符,它有 3 个字段:id(来自产品表)、代码(来自产品表)和描述,它是描述符表的特定字段。我想加入表格,因此对于产品 ID 和产品代码的每个唯一组合,我都希望添加描述。
The Sql is as follows ( this is correct):
Select Product.id, Product.code, Descriptor.DESCRIPTION
from Product Inner join Descriptor where
Product.id = Descriptor.id and
Product.code = Descriptor.code
(The error is in here)
The JPQL I am trying is as follows which results in a "path" error
select p from Product p INNER JOIN Descriptor d where
p.id = d.id and p.code = d.code;
非常欢迎所有建议谢谢