How to left join unrelated entities?

删除回忆录丶 提交于 2019-12-05 03:59:50

Joining unrelated entities is not possible with Querydsl JPA. Querydsl JPA uses JPQL internally and inherit's this restriction.

Assuming you're referring to JPA Criteria. innerJoin, leftOuterJoin are for joining relationships, since that is the only logical thing you would join on in an O-O system.

If instead you want to compare equality of entity.field with entity2.field (where no FK exists in the database and no relation exists in the classes) then do that in the WHERE clause, just like any filter.

Obviously QueryDSL has its own syntax/rules so if referring to that then this is not JPA

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!