Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的项目中使用 JPA 和休眠。
我遇到了一个需要加入 6 个表的查询。结果将给出 20 列。
我的实体类是:
产品协议
产品
我的 pojo 类是 AggregateDetail,它包含我将从本机查询中获得的所有 20 个变量。
有没有办法实现这一点。
我认为你可以这样做:
List<? extends Object> results=entityManager.createQuery("YOUR QUERY").getResultList();
最后,您可以转换结果,当然是在测试每个对象之后。