문제
나는 JPQL에서 작동하지 않는 일을하려고 노력했다.
JPQL :
select c from Car c
left join fetch c.owner
where c.type in (?1)
order by c.model
암호:
public List<Car> findCarsFilterByTypes(CarType[] types) {
return (List<Car>) this.entityManager.createNamedQuery("dealership.findCarsFilterByTypes")
.setParameter(1, types).getResultList();
}
배열을 사용하는 쉬운 경로가 작동하기를 바랐지만 ... 분명히는 ... 나는 쓸모없는 예외를 얻고 있습니다.
누구든지 내가 자동차 유형의 일부 목록에있는 모든 자동차를 얻는 방법을 알고 있습니까?
해결책
Ok Cartype [] 대신 목록을 사용하면 위의 코드가 잘 작동한다는 것을 알았습니다. :)
제휴하지 않습니다 StackOverflow