HQL加入-预期加入的路径!hibernate

HQL加入-预期加入的路径!hibernate,第1张

HQL加入-预期加入的路径!hibernate

如您所链接的问题和Hibernate文档中所述,实体之间的使用关联被联接。所以正确的查询是

select avg(t.price) from Ticket t join t.flight f where f.number = :flightNumber

Also note that using parameters is a much better solution than concatenating
values directly in the query. It handles quoting and escaping automatically,
and doesn’t have any risk of HQL injection.



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5560143.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-14
下一篇 2022-12-14

发表评论

登录后才能评论

评论列表(0条)

保存