如何离开不相关的实体? [英] How to left join unrelated entities?

查看:116
本文介绍了如何离开不相关的实体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行这样的查询时:

When i try to run a query like this:

QA A = QA.a;
QB B = QB.b;
...
from(A)
.leftJoin(B).with(B.name.eq(A.nameSomething));

(A和B实体无关) 我总是收到此错误:

(A and B entities are not related) I'm always getting this error:

Caused by: org.hibernate.hql.ast.QuerySyntaxException: Path expected for join!

我希望能够使用querydsl离开不相关的实体. 有可能吗? 还是唯一的方法是编写本地Oracle查询?

I would like to be able to left join unrelated entities using querydsl. Is it possible at all? Or the only way is to write a native Oracle query?

推荐答案

使用Querydsl JPA无法加入不相关的实体. Querydsl JPA在内部使用JPQL并继承了此限制.

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

这篇关于如何离开不相关的实体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆