复杂的SQL查询和JPQL [英] Complex sql query and JPQL

查看:56
本文介绍了复杂的SQL查询和JPQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将此复杂的sql语句更改为JPQL?

How to change this complex sql statement into JPQL?

select a.name, a.surname, b.street, c.location, c.location_desc
from table1 join table2 on b.id = a.some_fk
left join table3 d on d.id = a.id
left join table4 c on c.some2_id = d.some2_fk where a.id = 400;

这是否可能以JPQL形式出现?

If this is possible to present in the JPQL form?

推荐答案

JPQL是面向对象的,它针对JPA实体对象而不是数据库表进行操作.您需要更改Question并添加UML图表或提供Entity类.

JPQL is object oriented, it operates against JPA entity objects ,not database tables. Either you need to change the Question and add an UML diagramm or provide the Entity classes.

这篇关于复杂的SQL查询和JPQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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