【发布时间】:2017-07-29 22:43:40
【问题描述】:
我在下面有一个 HQL: from ProductMain as pm join fetch pm.person as ps join fetch pm.personProduct as pp join fetch pm.personReturn as pr join fetch pp.personObjects as po where pp.id in (180,000) and ps.id >= :lowRange and ps .id
似乎当我查询数据库时,我得到了每一列,这让我从数据库中得到一个 904 错误......有没有办法让特定的列返回以减小结果的大小? 就像如果我返回 100K 结果,每列有 100 列,我只想要返回 10 列.... 谢谢!
【问题讨论】:
-
有什么阻止你使用
select,例如select pm.col1, pm.col2 from ProductMain as pm ...? -
我可以这样做吗?所以我只是使用 ProductMain 中的 select pm.col1 , pm.col2 as pm join fetch pm.person as ps join fetch pm.personProduct as pp j 等?另外,假设还有其他与 ProductMain 链接的表,如 Car、House 等,我只需要它们的几列......我该如何实现?