我试图做一些显然在JPQL中不起作用的东西:
JPQL:
select c from Car c
left join fetch c.owner
where c.type in (?1)
order by c.model
Run Code Online (Sandbox Code Playgroud)
码:
public List<Car> findCarsFilterByTypes(CarType[] types) {
return (List<Car>) this.entityManager.createNamedQuery("dealership.findCarsFilterByTypes")
.setParameter(1, types).getResultList();
}
Run Code Online (Sandbox Code Playgroud)
我希望使用数组的简单方法可以工作......但显然不是......我得到了一个无用的例外.
任何人都知道我需要如何获得某些汽车类型列表中的所有汽车?
| 归档时间: |
|
| 查看次数: |
978 次 |
| 最近记录: |