I have a Many To Many relationship between two entities called: Car and Dealership.
In native MySQL I have:
car (id and other values)
dealership (id
select car from Car car
inner join car.dealerships dealership
where dealership in :dealerships
The parameter must be a collection of Dealership instances.
If you want to use a collection of dealership IDs, use
select car from Car car
inner join car.dealerships dealership
where dealership.id in :dealershipIds
Remamber that JPQL always use entities, mapped attributes and associations. Never table and column names.