We have a query with the following parts: {code:SQL} 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 ... {code}
The second one that doesn't have any parentheses is generated properly {code:SQL} WHERE hrt.hotel_id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,...) {code}
But the first part becomes {code:SQL} LEFT JOIN (reservation_detail rd INNER JOIN reservation r ON (r.id = rd.reservation_id AND r.status NOT IN ?, ?, ? )) {code}
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. Note that this is in a Named Native Query. It might work in JPQL queries, but we don't use them, because it's much harder to develop and test them in pgAdmin |
|