LEFT JOIN (reservation_detail rd INNER JOIN reservation r ON (r.id = rd.reservation_id AND r.status NOT IN :cancelled ))
...
WHERE hrt.hotel_id IN :hotelIds AND ...
The second one that doesn't have any parentheses is generated properly
LEFT JOIN (reservation_detail rd INNER JOIN reservation r ON (r.id = rd.reservation_id AND r.status NOT IN ?, ?, ? ))
Currently the workaround is to add the parentheses, so I'm submitting this as minor priority, but it's my understanding that the JPA implementation is supposed to add them.